From f814dc0391133da46cb0c0412f09694ab0658b27 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 2 Mar 2026 23:59:41 +0000 Subject: [PATCH 1/2] feat: expose the variable definition in the Cloud Firestore API chore: Firestore.executePipeline to not retry on `RESOURCE_EXHAUSTED` PiperOrigin-RevId: 877535984 Source-Link: https://github.com/googleapis/googleapis/commit/1ccd68a09ccd14f82d260a8edb96878027295675 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eaf17cfc03719eccdfb7b07989a1945ef34880f2 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWZpcmVzdG9yZS12MS8uT3dsQm90LnlhbWwiLCJoIjoiZWFmMTdjZmMwMzcxOWVjY2RmYjdiMDc5ODlhMTk0NWVmMzQ4ODBmMiJ9 --- .../google-cloud-firestore-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-firestore-v1/.rubocop.yml | 33 + .../google-cloud-firestore-v1/.toys.rb | 28 + .../google-cloud-firestore-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-firestore-v1/CHANGELOG.md | 2 + .../google-cloud-firestore-v1/Gemfile | 11 + .../google-cloud-firestore-v1/LICENSE.md | 201 ++ .../google-cloud-firestore-v1/README.md | 154 ++ .../google-cloud-firestore-v1/Rakefile | 169 ++ .../gapic_metadata.json | 103 + .../google-cloud-firestore-v1.gemspec | 29 + .../lib/google-cloud-firestore-v1.rb | 21 + .../lib/google/cloud/firestore/v1.rb | 45 + .../google/cloud/firestore/v1/firestore.rb | 61 + .../cloud/firestore/v1/firestore/client.rb | 2413 +++++++++++++++++ .../firestore/v1/firestore/credentials.rb | 52 + .../cloud/firestore/v1/firestore/rest.rb | 58 + .../firestore/v1/firestore/rest/client.rb | 2079 ++++++++++++++ .../v1/firestore/rest/service_stub.rb | 1026 +++++++ .../lib/google/cloud/firestore/v1/rest.rb | 37 + .../lib/google/cloud/firestore/v1/version.rb | 28 + .../firestore/v1/aggregation_result_pb.rb | 45 + .../google/firestore/v1/bloom_filter_pb.rb | 43 + .../lib/google/firestore/v1/common_pb.rb | 49 + .../lib/google/firestore/v1/document_pb.rb | 55 + .../google/firestore/v1/explain_stats_pb.rb | 45 + .../lib/google/firestore/v1/firestore_pb.rb | 103 + .../firestore/v1/firestore_services_pb.rb | 114 + .../lib/google/firestore/v1/pipeline_pb.rb | 46 + .../lib/google/firestore/v1/query_pb.rb | 68 + .../google/firestore/v1/query_profile_pb.rb | 51 + .../lib/google/firestore/v1/write_pb.rb | 59 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 ++ .../proto_docs/google/api/routing.rb | 459 ++++ .../google/firestore/v1/aggregation_result.rb | 53 + .../google/firestore/v1/bloom_filter.rb | 79 + .../proto_docs/google/firestore/v1/common.rb | 101 + .../google/firestore/v1/document.rb | 326 +++ .../google/firestore/v1/explain_stats.rb | 41 + .../google/firestore/v1/firestore.rb | 1110 ++++++++ .../google/firestore/v1/pipeline.rb | 51 + .../proto_docs/google/firestore/v1/query.rb | 629 +++++ .../google/firestore/v1/query_profile.rb | 98 + .../proto_docs/google/firestore/v1/write.rb | 317 +++ .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/struct.rb | 108 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/protobuf/wrappers.rb | 121 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/latlng.rb | 38 + .../snippets/Gemfile | 32 + .../snippets/firestore/batch_get_documents.rb | 50 + .../snippets/firestore/batch_write.rb | 47 + .../snippets/firestore/begin_transaction.rb | 47 + .../snippets/firestore/commit.rb | 47 + .../snippets/firestore/create_document.rb | 47 + .../snippets/firestore/delete_document.rb | 47 + .../snippets/firestore/execute_pipeline.rb | 50 + .../snippets/firestore/get_document.rb | 47 + .../snippets/firestore/list_collection_ids.rb | 47 + .../snippets/firestore/list_documents.rb | 51 + .../snippets/firestore/listen.rb | 56 + .../snippets/firestore/partition_query.rb | 51 + .../snippets/firestore/rollback.rb | 47 + .../firestore/run_aggregation_query.rb | 50 + .../snippets/firestore/run_query.rb | 50 + .../snippets/firestore/update_document.rb | 47 + .../snippets/firestore/write.rb | 56 + .../snippet_metadata_google.firestore.v1.json | 695 +++++ .../cloud/firestore/v1/firestore_rest_test.rb | 951 +++++++ .../cloud/firestore/v1/firestore_test.rb | 1329 +++++++++ .../google-cloud-firestore-v1/test/helper.rb | 25 + 80 files changed, 16114 insertions(+) create mode 100644 owl-bot-staging/google-cloud-firestore-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-firestore-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-firestore-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-firestore-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-firestore-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-firestore-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-firestore-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-firestore-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-firestore-v1/README.md create mode 100644 owl-bot-staging/google-cloud-firestore-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-firestore-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-firestore-v1/google-cloud-firestore-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google-cloud-firestore-v1.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/credentials.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/aggregation_result_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/bloom_filter_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/common_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/document_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/explain_stats_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/firestore_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/firestore_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/pipeline_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/query_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/query_profile_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/write_pb.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/routing.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/aggregation_result.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/bloom_filter.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/common.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/document.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/explain_stats.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/firestore.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/pipeline.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query_profile.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/write.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/type/latlng.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/batch_get_documents.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/batch_write.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/begin_transaction.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/commit.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/create_document.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/delete_document.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/execute_pipeline.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/get_document.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_collection_ids.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_documents.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/listen.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/partition_query.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/rollback.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_aggregation_query.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_query.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/update_document.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/write.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/snippet_metadata_google.firestore.v1.json create mode 100644 owl-bot-staging/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_test.rb create mode 100644 owl-bot-staging/google-cloud-firestore-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-firestore-v1/.gitignore b/owl-bot-staging/google-cloud-firestore-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-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-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-firestore-v1/.repo-metadata.json new file mode 100644 index 000000000000..195e6cac6d41 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-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-v1/latest", + "distribution_name": "google-cloud-firestore-v1", + "is_cloud": true, + "language": "ruby", + "name": "firestore", + "name_pretty": "Cloud Firestore 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-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-firestore 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-v1/.rubocop.yml b/owl-bot-staging/google-cloud-firestore-v1/.rubocop.yml new file mode 100644 index 000000000000..b39192458484 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-firestore-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-v1.rb" diff --git a/owl-bot-staging/google-cloud-firestore-v1/.toys.rb b/owl-bot-staging/google-cloud-firestore-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/.yardopts b/owl-bot-staging/google-cloud-firestore-v1/.yardopts new file mode 100644 index 000000000000..3ca29a5a2e96 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Firestore 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-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-firestore-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..928670fe30c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-firestore-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-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/v1" + +client = ::Google::Cloud::Firestore::V1::Firestore::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/v1" + +::Google::Cloud::Firestore::V1::Firestore::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Firestore::V1::Firestore::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-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/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Firestore::V1::Firestore::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-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-firestore-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-firestore-v1/Gemfile b/owl-bot-staging/google-cloud-firestore-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-firestore-v1/LICENSE.md b/owl-bot-staging/google-cloud-firestore-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-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-v1/README.md b/owl-bot-staging/google-cloud-firestore-v1/README.md new file mode 100644 index 000000000000..f635e3ad0443 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Firestore 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 V1 API. Most users should consider using +the main client gem, +[google-cloud-firestore](https://rubygems.org/gems/google-cloud-firestore). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-firestore-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/v1" + +client = ::Google::Cloud::Firestore::V1::Firestore::Client.new +request = ::Google::Cloud::Firestore::V1::GetDocumentRequest.new # (request fields as keyword arguments...) +response = client.get_document request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/firestore) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/firestore/v1" +require "logger" + +client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-firestore`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-firestore-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`. +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-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-v1/Rakefile b/owl-bot-staging/google-cloud-firestore-v1/Rakefile new file mode 100644 index 000000000000..070c05371228 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-firestore-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/v1/firestore/credentials" + ::Google::Cloud::Firestore::V1::Firestore::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-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-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-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-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-firestore-v1" + header "google-cloud-firestore-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-firestore-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-firestore-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-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-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-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-firestore-v1/gapic_metadata.json new file mode 100644 index 000000000000..46f4f6d27b0b --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/gapic_metadata.json @@ -0,0 +1,103 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.firestore.v1", + "libraryPackage": "::Google::Cloud::Firestore::V1", + "services": { + "Firestore": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Firestore::V1::Firestore::Client", + "rpcs": { + "GetDocument": { + "methods": [ + "get_document" + ] + }, + "ListDocuments": { + "methods": [ + "list_documents" + ] + }, + "UpdateDocument": { + "methods": [ + "update_document" + ] + }, + "DeleteDocument": { + "methods": [ + "delete_document" + ] + }, + "BatchGetDocuments": { + "methods": [ + "batch_get_documents" + ] + }, + "BeginTransaction": { + "methods": [ + "begin_transaction" + ] + }, + "Commit": { + "methods": [ + "commit" + ] + }, + "Rollback": { + "methods": [ + "rollback" + ] + }, + "RunQuery": { + "methods": [ + "run_query" + ] + }, + "ExecutePipeline": { + "methods": [ + "execute_pipeline" + ] + }, + "RunAggregationQuery": { + "methods": [ + "run_aggregation_query" + ] + }, + "PartitionQuery": { + "methods": [ + "partition_query" + ] + }, + "Write": { + "methods": [ + "write" + ] + }, + "Listen": { + "methods": [ + "listen" + ] + }, + "ListCollectionIds": { + "methods": [ + "list_collection_ids" + ] + }, + "BatchWrite": { + "methods": [ + "batch_write" + ] + }, + "CreateDocument": { + "methods": [ + "create_document" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-firestore-v1/google-cloud-firestore-v1.gemspec b/owl-bot-staging/google-cloud-firestore-v1/google-cloud-firestore-v1.gemspec new file mode 100644 index 000000000000..9821a35b2173 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/google-cloud-firestore-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/firestore/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-firestore-v1" + gem.version = Google::Cloud::Firestore::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-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-firestore 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 = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google-cloud-firestore-v1.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google-cloud-firestore-v1.rb new file mode 100644 index 000000000000..a06d65d7c71a --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google-cloud-firestore-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/firestore/v1" diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1.rb new file mode 100644 index 000000000000..b062b442952c --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/firestore/v1/firestore" +require "google/cloud/firestore/v1/version" + +module Google + module Cloud + module Firestore + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/firestore/v1" + # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/firestore/v1" + # client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/firestore/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore.rb new file mode 100644 index 000000000000..839d1e4340f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/firestore/v1/version" + +require "google/cloud/firestore/v1/firestore/credentials" +require "google/cloud/firestore/v1/firestore/client" +require "google/cloud/firestore/v1/firestore/rest" + +module Google + module Cloud + module Firestore + module V1 + ## + # The Cloud Firestore service. + # + # Cloud Firestore is a fast, fully managed, serverless, cloud-native NoSQL + # document database that simplifies storing, syncing, and querying data for + # your mobile, web, and IoT apps at global scale. Its client libraries provide + # live synchronization and offline support, while its security features and + # integrations with Firebase and Google Cloud Platform accelerate building + # truly serverless apps. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/firestore/v1/firestore" + # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/firestore/v1/firestore/rest" + # client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + module Firestore + end + end + end + end +end + +helper_path = ::File.join __dir__, "firestore", "helpers.rb" +require "google/cloud/firestore/v1/firestore/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb new file mode 100644 index 000000000000..af67bc0641db --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb @@ -0,0 +1,2413 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/firestore/v1/firestore_pb" +require "google/cloud/location" + +module Google + module Cloud + module Firestore + module V1 + module Firestore + ## + # Client for the Firestore service. + # + # The Cloud Firestore service. + # + # Cloud Firestore is a fast, fully managed, serverless, cloud-native NoSQL + # document database that simplifies storing, syncing, and querying data for + # your mobile, web, and IoT apps at global scale. Its client libraries provide + # live synchronization and offline support, while its security features and + # integrations with Firebase and Google Cloud Platform accelerate building + # truly serverless apps. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "firestore.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :firestore_stub + + ## + # Configure the Firestore Client class. + # + # See {::Google::Cloud::Firestore::V1::Firestore::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Firestore clients + # ::Google::Cloud::Firestore::V1::Firestore::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", "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.get_document.timeout = 60.0 + default_config.rpcs.get_document.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + } + + default_config.rpcs.list_documents.timeout = 60.0 + default_config.rpcs.list_documents.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + } + + default_config.rpcs.update_document.timeout = 60.0 + default_config.rpcs.update_document.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14] + } + + default_config.rpcs.delete_document.timeout = 60.0 + default_config.rpcs.delete_document.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + } + + default_config.rpcs.batch_get_documents.timeout = 300.0 + default_config.rpcs.batch_get_documents.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.begin_transaction.timeout = 60.0 + default_config.rpcs.begin_transaction.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + } + + default_config.rpcs.commit.timeout = 60.0 + default_config.rpcs.commit.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14] + } + + default_config.rpcs.rollback.timeout = 60.0 + default_config.rpcs.rollback.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + } + + default_config.rpcs.run_query.timeout = 300.0 + default_config.rpcs.run_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.execute_pipeline.timeout = 300.0 + default_config.rpcs.execute_pipeline.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.run_aggregation_query.timeout = 300.0 + default_config.rpcs.run_aggregation_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.partition_query.timeout = 300.0 + default_config.rpcs.partition_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.write.timeout = 86_400.0 + + default_config.rpcs.listen.timeout = 86_400.0 + default_config.rpcs.listen.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + } + + default_config.rpcs.list_collection_ids.timeout = 60.0 + default_config.rpcs.list_collection_ids.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + } + + default_config.rpcs.batch_write.timeout = 60.0 + default_config.rpcs.batch_write.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 10] + } + + default_config.rpcs.create_document.timeout = 60.0 + default_config.rpcs.create_document.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Firestore 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::V1::Firestore::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_stub.universe_domain + end + + ## + # Create a new Firestore client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Firestore 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/v1/firestore_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 + + @firestore_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Firestore::V1::Firestore::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @firestore_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @firestore_stub.endpoint + config.universe_domain = @firestore_stub.universe_domain + config.logger = @firestore_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @firestore_stub.logger + end + + # Service calls + + ## + # Gets a single document. + # + # @overload get_document(request, options = nil) + # Pass arguments to `get_document` via a request object, either of type + # {::Google::Cloud::Firestore::V1::GetDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::GetDocumentRequest, ::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_document(name: nil, mask: nil, transaction: nil, read_time: nil) + # Pass arguments to `get_document` 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 resource name of the Document to get. In the format: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] + # The fields to return. If not set, returns all fields. + # + # If the document has a field that is not present in this mask, that field + # will not be returned in the response. + # @param transaction [::String] + # Reads the document in a transaction. + # + # Note: The following parameters are mutually exclusive: `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Reads the version of the document at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following parameters are mutually exclusive: `read_time`, `transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::V1::Document] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::V1::Document] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::GetDocumentRequest.new + # + # # Call the get_document method. + # result = client.get_document request + # + # # The returned object is of type Google::Cloud::Firestore::V1::Document. + # p result + # + def get_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::GetDocumentRequest + + # 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_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :get_document, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists documents. + # + # @overload list_documents(request, options = nil) + # Pass arguments to `list_documents` via a request object, either of type + # {::Google::Cloud::Firestore::V1::ListDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::ListDocumentsRequest, ::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_documents(parent: nil, collection_id: nil, page_size: nil, page_token: nil, order_by: nil, mask: nil, transaction: nil, read_time: nil, show_missing: nil) + # Pass arguments to `list_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 parent [::String] + # Required. The parent resource name. In the format: + # `projects/{project_id}/databases/{database_id}/documents` or + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # + # For example: + # `projects/my-project/databases/my-database/documents` or + # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + # @param collection_id [::String] + # Optional. The collection ID, relative to `parent`, to list. + # + # For example: `chatrooms` or `messages`. + # + # This is optional, and when not provided, Firestore will list documents + # from all collections under the provided `parent`. + # @param page_size [::Integer] + # Optional. The maximum number of documents to return in a single response. + # + # Firestore may return fewer than this value. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListDocuments` response. + # + # Provide this to retrieve the subsequent page. When paginating, all other + # parameters (with the exception of `page_size`) must match the values set + # in the request that generated the page token. + # @param order_by [::String] + # Optional. The optional ordering of the documents to return. + # + # For example: `priority desc, __name__ desc`. + # + # This mirrors the {::Google::Cloud::Firestore::V1::StructuredQuery#order_by `ORDER BY`} + # used in Firestore queries but in a string representation. When absent, + # documents are ordered based on `__name__ ASC`. + # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] + # Optional. The fields to return. If not set, returns all fields. + # + # If a document has a field that is not present in this mask, that field + # will not be returned in the response. + # @param transaction [::String] + # Perform the read as part of an already active transaction. + # + # Note: The following parameters are mutually exclusive: `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Perform the read at the provided time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following parameters are mutually exclusive: `read_time`, `transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param show_missing [::Boolean] + # If the list should show missing documents. + # + # A document is missing if it does not exist, but there are sub-documents + # nested underneath it. When true, such missing documents will be returned + # with a key but will not have fields, + # {::Google::Cloud::Firestore::V1::Document#create_time `create_time`}, or + # {::Google::Cloud::Firestore::V1::Document#update_time `update_time`} set. + # + # Requests with `show_missing` may not specify `where` or `order_by`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Document>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Document>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::ListDocumentsRequest.new + # + # # Call the list_documents method. + # result = client.list_documents 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::V1::Document. + # p item + # end + # + def list_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::ListDocumentsRequest + + # 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_documents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + if request.collection_id + header_params["collection_id"] = request.collection_id + 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_documents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :list_documents, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @firestore_stub, :list_documents, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates or inserts a document. + # + # @overload update_document(request, options = nil) + # Pass arguments to `update_document` via a request object, either of type + # {::Google::Cloud::Firestore::V1::UpdateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::UpdateDocumentRequest, ::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_document(document: nil, update_mask: nil, mask: nil, current_document: nil) + # Pass arguments to `update_document` 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 document [::Google::Cloud::Firestore::V1::Document, ::Hash] + # Required. The updated document. + # Creates the document if it does not already exist. + # @param update_mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] + # The fields to update. + # None of the field paths in the mask may contain a reserved name. + # + # If the document exists on the server and has fields not referenced in the + # mask, they are left unchanged. + # Fields referenced in the mask, but not present in the input document, are + # deleted from the document on the server. + # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] + # The fields to return. If not set, returns all fields. + # + # If the document has a field that is not present in this mask, that field + # will not be returned in the response. + # @param current_document [::Google::Cloud::Firestore::V1::Precondition, ::Hash] + # An optional precondition on the document. + # The request will fail if this is set and not met by the target document. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::V1::Document] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::V1::Document] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::UpdateDocumentRequest.new + # + # # Call the update_document method. + # result = client.update_document request + # + # # The returned object is of type Google::Cloud::Firestore::V1::Document. + # p result + # + def update_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::UpdateDocumentRequest + + # 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_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.document&.name + header_params["document.name"] = request.document.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_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :update_document, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a document. + # + # @overload delete_document(request, options = nil) + # Pass arguments to `delete_document` via a request object, either of type + # {::Google::Cloud::Firestore::V1::DeleteDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::DeleteDocumentRequest, ::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_document(name: nil, current_document: nil) + # Pass arguments to `delete_document` 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 resource name of the Document to delete. In the format: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # @param current_document [::Google::Cloud::Firestore::V1::Precondition, ::Hash] + # An optional precondition on the document. + # The request will fail if this is set and not met by the target document. + # + # @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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::DeleteDocumentRequest.new + # + # # Call the delete_document method. + # result = client.delete_document request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::DeleteDocumentRequest + + # 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_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :delete_document, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets multiple documents. + # + # Documents returned by this method are not guaranteed to be returned in the + # same order that they were requested. + # + # @overload batch_get_documents(request, options = nil) + # Pass arguments to `batch_get_documents` via a request object, either of type + # {::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_get_documents(database: nil, documents: nil, mask: nil, transaction: nil, new_transaction: nil, read_time: nil) + # Pass arguments to `batch_get_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 database [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @param documents [::Array<::String>] + # The names of the documents to retrieve. In the format: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # The request will fail if any of the document is not a child resource of the + # given `database`. Duplicate names will be elided. + # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] + # The fields to return. If not set, returns all fields. + # + # If a document has a field that is not present in this mask, that field will + # not be returned in the response. + # @param transaction [::String] + # Reads documents in a transaction. + # + # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] + # Starts a new transaction and reads the documents. + # Defaults to a read-only transaction. + # The new transaction ID will be returned as the first response in the + # stream. + # + # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Reads documents as they were at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new + # + # # Call the batch_get_documents method to start streaming. + # output = client.batch_get_documents request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse + # output.each do |current_response| + # p current_response + # end + # + def batch_get_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_get_documents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + header_params["database"] = request.database + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_get_documents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_get_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :batch_get_documents, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts a new transaction. + # + # @overload begin_transaction(request, options = nil) + # Pass arguments to `begin_transaction` via a request object, either of type + # {::Google::Cloud::Firestore::V1::BeginTransactionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::BeginTransactionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload begin_transaction(database: nil, options: nil) + # Pass arguments to `begin_transaction` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @param options [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] + # The options for the transaction. + # Defaults to a read-write transaction. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::V1::BeginTransactionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::V1::BeginTransactionResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::BeginTransactionRequest.new + # + # # Call the begin_transaction method. + # result = client.begin_transaction request + # + # # The returned object is of type Google::Cloud::Firestore::V1::BeginTransactionResponse. + # p result + # + def begin_transaction request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::BeginTransactionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.begin_transaction.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + header_params["database"] = request.database + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.begin_transaction.timeout, + metadata: metadata, + retry_policy: @config.rpcs.begin_transaction.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :begin_transaction, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Commits a transaction, while optionally updating documents. + # + # @overload commit(request, options = nil) + # Pass arguments to `commit` via a request object, either of type + # {::Google::Cloud::Firestore::V1::CommitRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::CommitRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload commit(database: nil, writes: nil, transaction: nil) + # Pass arguments to `commit` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @param writes [::Array<::Google::Cloud::Firestore::V1::Write, ::Hash>] + # The writes to apply. + # + # Always executed atomically and in order. + # @param transaction [::String] + # If set, applies all writes in this transaction, and commits it. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::V1::CommitResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::V1::CommitResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::CommitRequest.new + # + # # Call the commit method. + # result = client.commit request + # + # # The returned object is of type Google::Cloud::Firestore::V1::CommitResponse. + # p result + # + def commit request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::CommitRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.commit.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + header_params["database"] = request.database + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.commit.timeout, + metadata: metadata, + retry_policy: @config.rpcs.commit.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :commit, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Rolls back a transaction. + # + # @overload rollback(request, options = nil) + # Pass arguments to `rollback` via a request object, either of type + # {::Google::Cloud::Firestore::V1::RollbackRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::RollbackRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload rollback(database: nil, transaction: nil) + # Pass arguments to `rollback` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @param transaction [::String] + # Required. The transaction to roll back. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::RollbackRequest.new + # + # # Call the rollback method. + # result = client.rollback request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def rollback request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::RollbackRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.rollback.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + header_params["database"] = request.database + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.rollback.timeout, + metadata: metadata, + retry_policy: @config.rpcs.rollback.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :rollback, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Runs a query. + # + # @overload run_query(request, options = nil) + # Pass arguments to `run_query` via a request object, either of type + # {::Google::Cloud::Firestore::V1::RunQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::RunQueryRequest, ::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 run_query(parent: nil, structured_query: nil, transaction: nil, new_transaction: nil, read_time: nil, explain_options: nil) + # Pass arguments to `run_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. In the format: + # `projects/{project_id}/databases/{database_id}/documents` or + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # For example: + # `projects/my-project/databases/my-database/documents` or + # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + # @param structured_query [::Google::Cloud::Firestore::V1::StructuredQuery, ::Hash] + # A structured query. + # @param transaction [::String] + # Run the query within an already active transaction. + # + # The value here is the opaque transaction ID to execute the query in. + # + # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] + # Starts a new transaction and reads the documents. + # Defaults to a read-only transaction. + # The new transaction ID will be returned as the first response in the + # stream. + # + # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Reads documents as they were at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param explain_options [::Google::Cloud::Firestore::V1::ExplainOptions, ::Hash] + # Optional. Explain options for the query. If set, additional query + # statistics will be returned. If not, only query results will be returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Firestore::V1::RunQueryResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Firestore::V1::RunQueryResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::RunQueryRequest.new + # + # # Call the run_query method to start streaming. + # output = client.run_query request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Firestore::V1::RunQueryResponse + # output.each do |current_response| + # p current_response + # end + # + def run_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::RunQueryRequest + + # 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.run_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.run_query.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :run_query, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Executes a pipeline query. + # + # @overload execute_pipeline(request, options = nil) + # Pass arguments to `execute_pipeline` via a request object, either of type + # {::Google::Cloud::Firestore::V1::ExecutePipelineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::ExecutePipelineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload execute_pipeline(database: nil, structured_pipeline: nil, transaction: nil, new_transaction: nil, read_time: nil) + # Pass arguments to `execute_pipeline` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. Database identifier, in the form + # `projects/{project}/databases/{database}`. + # @param structured_pipeline [::Google::Cloud::Firestore::V1::StructuredPipeline, ::Hash] + # A pipelined operation. + # @param transaction [::String] + # Run the query within an already active transaction. + # + # The value here is the opaque transaction ID to execute the query in. + # + # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] + # Execute the pipeline in a new transaction. + # + # The identifier of the newly created transaction will be returned in the + # first response on the stream. This defaults to a read-only transaction. + # + # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Execute the pipeline in a snapshot transaction at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Firestore::V1::ExecutePipelineResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Firestore::V1::ExecutePipelineResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::ExecutePipelineRequest.new + # + # # Call the execute_pipeline method to start streaming. + # output = client.execute_pipeline request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Firestore::V1::ExecutePipelineResponse + # output.each do |current_response| + # p current_response + # end + # + def execute_pipeline request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::ExecutePipelineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.execute_pipeline.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + regex_match = %r{^projects/(?[^/]+)(?:/.*)?$}.match request.database + if regex_match + header_params["project_id"] = regex_match["project_id".to_s] + end + end + if request.database + regex_match = %r{^projects/[^/]+/databases/(?[^/]+)(?:/.*)?$}.match request.database + if regex_match + header_params["database_id"] = regex_match["database_id".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.execute_pipeline.timeout, + metadata: metadata, + retry_policy: @config.rpcs.execute_pipeline.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :execute_pipeline, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Runs an aggregation query. + # + # Rather than producing {::Google::Cloud::Firestore::V1::Document Document} results like + # {::Google::Cloud::Firestore::V1::Firestore::Client#run_query Firestore.RunQuery}, this API + # allows running an aggregation to produce a series of + # {::Google::Cloud::Firestore::V1::AggregationResult AggregationResult} server-side. + # + # High-Level Example: + # + # ``` + # -- Return the number of documents in table given a filter. + # SELECT COUNT(*) FROM ( SELECT * FROM k where a = true ); + # ``` + # + # @overload run_aggregation_query(request, options = nil) + # Pass arguments to `run_aggregation_query` via a request object, either of type + # {::Google::Cloud::Firestore::V1::RunAggregationQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::RunAggregationQueryRequest, ::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 run_aggregation_query(parent: nil, structured_aggregation_query: nil, transaction: nil, new_transaction: nil, read_time: nil, explain_options: nil) + # Pass arguments to `run_aggregation_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. In the format: + # `projects/{project_id}/databases/{database_id}/documents` or + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # For example: + # `projects/my-project/databases/my-database/documents` or + # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + # @param structured_aggregation_query [::Google::Cloud::Firestore::V1::StructuredAggregationQuery, ::Hash] + # An aggregation query. + # @param transaction [::String] + # Run the aggregation within an already active transaction. + # + # The value here is the opaque transaction ID to execute the query in. + # + # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] + # Starts a new transaction as part of the query, defaulting to read-only. + # + # The new transaction ID will be returned as the first response in the + # stream. + # + # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Executes the query at the given timestamp. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param explain_options [::Google::Cloud::Firestore::V1::ExplainOptions, ::Hash] + # Optional. Explain options for the query. If set, additional query + # statistics will be returned. If not, only query results will be returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Firestore::V1::RunAggregationQueryResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Firestore::V1::RunAggregationQueryResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new + # + # # Call the run_aggregation_query method to start streaming. + # output = client.run_aggregation_query request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse + # output.each do |current_response| + # p current_response + # end + # + def run_aggregation_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::RunAggregationQueryRequest + + # 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.run_aggregation_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.run_aggregation_query.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_aggregation_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :run_aggregation_query, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Partitions a query by returning partition cursors that can be used to run + # the query in parallel. The returned partition cursors are split points that + # can be used by RunQuery as starting/end points for the query results. + # + # @overload partition_query(request, options = nil) + # Pass arguments to `partition_query` via a request object, either of type + # {::Google::Cloud::Firestore::V1::PartitionQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::PartitionQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload partition_query(parent: nil, structured_query: nil, partition_count: nil, page_token: nil, page_size: nil, read_time: nil) + # Pass arguments to `partition_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. In the format: + # `projects/{project_id}/databases/{database_id}/documents`. + # Document resource names are not supported; only database resource names + # can be specified. + # @param structured_query [::Google::Cloud::Firestore::V1::StructuredQuery, ::Hash] + # A structured query. + # Query must specify collection with all descendants and be ordered by name + # ascending. Other filters, order bys, limits, offsets, and start/end + # cursors are not supported. + # @param partition_count [::Integer] + # The desired maximum number of partition points. + # The partitions may be returned across multiple pages of results. + # The number must be positive. The actual number of partitions + # returned may be fewer. + # + # For example, this may be set to one fewer than the number of parallel + # queries to be run, or in running a data pipeline job, one fewer than the + # number of workers or compute instances available. + # @param page_token [::String] + # The `next_page_token` value returned from a previous call to + # PartitionQuery that may be used to get an additional set of results. + # There are no ordering guarantees between sets of results. Thus, using + # multiple sets of results will require merging the different result sets. + # + # For example, two subsequent calls using a page_token may return: + # + # * cursor B, cursor M, cursor Q + # * cursor A, cursor U, cursor W + # + # To obtain a complete result set ordered with respect to the results of the + # query supplied to PartitionQuery, the results sets should be merged: + # cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W + # @param page_size [::Integer] + # The maximum number of partitions to return in this call, subject to + # `partition_count`. + # + # For example, if `partition_count` = 10 and `page_size` = 8, the first call + # to PartitionQuery will return up to 8 partitions and a `next_page_token` + # if more results exist. A second call to PartitionQuery will return up to + # 2 partitions, to complete the total of 10 specified in `partition_count`. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Reads documents as they were at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Cursor>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Cursor>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::PartitionQueryRequest.new + # + # # Call the partition_query method. + # result = client.partition_query 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::V1::Cursor. + # p item + # end + # + def partition_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::PartitionQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.partition_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.partition_query.timeout, + metadata: metadata, + retry_policy: @config.rpcs.partition_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :partition_query, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @firestore_stub, :partition_query, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Streams batches of document updates and deletes, in order. This method is + # only available via gRPC or WebChannel (not REST). + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Firestore::V1::WriteRequest, ::Hash>] + # An enumerable of {::Google::Cloud::Firestore::V1::WriteRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Firestore::V1::WriteResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Firestore::V1::WriteResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the write method to start streaming. + # output = client.write input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::Firestore::V1::WriteRequest.new + # input << Google::Cloud::Firestore::V1::WriteRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Firestore::V1::WriteResponse + # output.each do |current_response| + # p current_response + # end + # + def write request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Firestore::V1::WriteRequest + end + + # 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.write.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.write.timeout, + metadata: metadata, + retry_policy: @config.rpcs.write.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :write, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Listens to changes. This method is only available via gRPC or WebChannel + # (not REST). + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Firestore::V1::ListenRequest, ::Hash>] + # An enumerable of {::Google::Cloud::Firestore::V1::ListenRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Firestore::V1::ListenResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Firestore::V1::ListenResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the listen method to start streaming. + # output = client.listen input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::Firestore::V1::ListenRequest.new + # input << Google::Cloud::Firestore::V1::ListenRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Firestore::V1::ListenResponse + # output.each do |current_response| + # p current_response + # end + # + def listen request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Firestore::V1::ListenRequest + end + + # 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.listen.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.listen.timeout, + metadata: metadata, + retry_policy: @config.rpcs.listen.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :listen, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the collection IDs underneath a document. + # + # @overload list_collection_ids(request, options = nil) + # Pass arguments to `list_collection_ids` via a request object, either of type + # {::Google::Cloud::Firestore::V1::ListCollectionIdsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::ListCollectionIdsRequest, ::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_collection_ids(parent: nil, page_size: nil, page_token: nil, read_time: nil) + # Pass arguments to `list_collection_ids` 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 document. In the format: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # For example: + # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + # @param page_size [::Integer] + # The maximum number of results to return. + # @param page_token [::String] + # A page token. Must be a value from + # {::Google::Cloud::Firestore::V1::ListCollectionIdsResponse ListCollectionIdsResponse}. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Reads documents as they were at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::V1::ListCollectionIdsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::V1::ListCollectionIdsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new + # + # # Call the list_collection_ids method. + # result = client.list_collection_ids request + # + # # The returned object is of type Google::Cloud::Firestore::V1::ListCollectionIdsResponse. + # p result + # + def list_collection_ids request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::ListCollectionIdsRequest + + # 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_collection_ids.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_collection_ids.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_collection_ids.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :list_collection_ids, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Applies a batch of write operations. + # + # The BatchWrite method does not apply the write operations atomically + # and can apply them out of order. Method does not allow more than one write + # per document. Each write succeeds or fails independently. See the + # {::Google::Cloud::Firestore::V1::BatchWriteResponse BatchWriteResponse} for the + # success status of each write. + # + # If you require an atomically applied set of writes, use + # {::Google::Cloud::Firestore::V1::Firestore::Client#commit Commit} instead. + # + # @overload batch_write(request, options = nil) + # Pass arguments to `batch_write` via a request object, either of type + # {::Google::Cloud::Firestore::V1::BatchWriteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::BatchWriteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_write(database: nil, writes: nil, labels: nil) + # Pass arguments to `batch_write` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @param writes [::Array<::Google::Cloud::Firestore::V1::Write, ::Hash>] + # The writes to apply. + # + # Method does not apply writes atomically and does not guarantee ordering. + # Each write succeeds or fails independently. You cannot write to the same + # document more than once per request. + # @param labels [::Hash{::String => ::String}] + # Labels associated with this batch write. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::V1::BatchWriteResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::V1::BatchWriteResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::BatchWriteRequest.new + # + # # Call the batch_write method. + # result = client.batch_write request + # + # # The returned object is of type Google::Cloud::Firestore::V1::BatchWriteResponse. + # p result + # + def batch_write request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::BatchWriteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_write.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.database + header_params["database"] = request.database + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_write.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_write.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :batch_write, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new document. + # + # @overload create_document(request, options = nil) + # Pass arguments to `create_document` via a request object, either of type + # {::Google::Cloud::Firestore::V1::CreateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::CreateDocumentRequest, ::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_document(parent: nil, collection_id: nil, document_id: nil, document: nil, mask: nil) + # Pass arguments to `create_document` 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 resource. For example: + # `projects/{project_id}/databases/{database_id}/documents` or + # `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + # @param collection_id [::String] + # Required. The collection ID, relative to `parent`, to list. For example: + # `chatrooms`. + # @param document_id [::String] + # The client-assigned document ID to use for this document. + # + # Optional. If not specified, an ID will be assigned by the service. + # @param document [::Google::Cloud::Firestore::V1::Document, ::Hash] + # Required. The document to create. `name` must not be set. + # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] + # The fields to return. If not set, returns all fields. + # + # If the document has a field that is not present in this mask, that field + # will not be returned in the response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Firestore::V1::Document] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Firestore::V1::Document] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::CreateDocumentRequest.new + # + # # Call the create_document method. + # result = client.create_document request + # + # # The returned object is of type Google::Cloud::Firestore::V1::Document. + # p result + # + def create_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::CreateDocumentRequest + + # 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_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + if request.collection_id + header_params["collection_id"] = request.collection_id + 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_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.call_rpc :create_document, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Firestore API. + # + # This class represents the configuration for Firestore, + # 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::V1::Firestore::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 + # # get_document to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Firestore::V1::Firestore::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_document.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_document.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "firestore.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Firestore 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 `get_document` + # @return [::Gapic::Config::Method] + # + attr_reader :get_document + ## + # RPC-specific configuration for `list_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :list_documents + ## + # RPC-specific configuration for `update_document` + # @return [::Gapic::Config::Method] + # + attr_reader :update_document + ## + # RPC-specific configuration for `delete_document` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_document + ## + # RPC-specific configuration for `batch_get_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_get_documents + ## + # RPC-specific configuration for `begin_transaction` + # @return [::Gapic::Config::Method] + # + attr_reader :begin_transaction + ## + # RPC-specific configuration for `commit` + # @return [::Gapic::Config::Method] + # + attr_reader :commit + ## + # RPC-specific configuration for `rollback` + # @return [::Gapic::Config::Method] + # + attr_reader :rollback + ## + # RPC-specific configuration for `run_query` + # @return [::Gapic::Config::Method] + # + attr_reader :run_query + ## + # RPC-specific configuration for `execute_pipeline` + # @return [::Gapic::Config::Method] + # + attr_reader :execute_pipeline + ## + # RPC-specific configuration for `run_aggregation_query` + # @return [::Gapic::Config::Method] + # + attr_reader :run_aggregation_query + ## + # RPC-specific configuration for `partition_query` + # @return [::Gapic::Config::Method] + # + attr_reader :partition_query + ## + # RPC-specific configuration for `write` + # @return [::Gapic::Config::Method] + # + attr_reader :write + ## + # RPC-specific configuration for `listen` + # @return [::Gapic::Config::Method] + # + attr_reader :listen + ## + # RPC-specific configuration for `list_collection_ids` + # @return [::Gapic::Config::Method] + # + attr_reader :list_collection_ids + ## + # RPC-specific configuration for `batch_write` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_write + ## + # RPC-specific configuration for `create_document` + # @return [::Gapic::Config::Method] + # + attr_reader :create_document + + # @private + def initialize parent_rpcs = nil + get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document + @get_document = ::Gapic::Config::Method.new get_document_config + list_documents_config = parent_rpcs.list_documents if parent_rpcs.respond_to? :list_documents + @list_documents = ::Gapic::Config::Method.new list_documents_config + update_document_config = parent_rpcs.update_document if parent_rpcs.respond_to? :update_document + @update_document = ::Gapic::Config::Method.new update_document_config + delete_document_config = parent_rpcs.delete_document if parent_rpcs.respond_to? :delete_document + @delete_document = ::Gapic::Config::Method.new delete_document_config + batch_get_documents_config = parent_rpcs.batch_get_documents if parent_rpcs.respond_to? :batch_get_documents + @batch_get_documents = ::Gapic::Config::Method.new batch_get_documents_config + begin_transaction_config = parent_rpcs.begin_transaction if parent_rpcs.respond_to? :begin_transaction + @begin_transaction = ::Gapic::Config::Method.new begin_transaction_config + commit_config = parent_rpcs.commit if parent_rpcs.respond_to? :commit + @commit = ::Gapic::Config::Method.new commit_config + rollback_config = parent_rpcs.rollback if parent_rpcs.respond_to? :rollback + @rollback = ::Gapic::Config::Method.new rollback_config + run_query_config = parent_rpcs.run_query if parent_rpcs.respond_to? :run_query + @run_query = ::Gapic::Config::Method.new run_query_config + execute_pipeline_config = parent_rpcs.execute_pipeline if parent_rpcs.respond_to? :execute_pipeline + @execute_pipeline = ::Gapic::Config::Method.new execute_pipeline_config + run_aggregation_query_config = parent_rpcs.run_aggregation_query if parent_rpcs.respond_to? :run_aggregation_query + @run_aggregation_query = ::Gapic::Config::Method.new run_aggregation_query_config + partition_query_config = parent_rpcs.partition_query if parent_rpcs.respond_to? :partition_query + @partition_query = ::Gapic::Config::Method.new partition_query_config + write_config = parent_rpcs.write if parent_rpcs.respond_to? :write + @write = ::Gapic::Config::Method.new write_config + listen_config = parent_rpcs.listen if parent_rpcs.respond_to? :listen + @listen = ::Gapic::Config::Method.new listen_config + list_collection_ids_config = parent_rpcs.list_collection_ids if parent_rpcs.respond_to? :list_collection_ids + @list_collection_ids = ::Gapic::Config::Method.new list_collection_ids_config + batch_write_config = parent_rpcs.batch_write if parent_rpcs.respond_to? :batch_write + @batch_write = ::Gapic::Config::Method.new batch_write_config + create_document_config = parent_rpcs.create_document if parent_rpcs.respond_to? :create_document + @create_document = ::Gapic::Config::Method.new create_document_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/credentials.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/credentials.rb new file mode 100644 index 000000000000..b86cdeb94a6f --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Firestore + module V1 + module Firestore + # Credentials for the Firestore 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 diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest.rb new file mode 100644 index 000000000000..a26df12bed6b --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/firestore/v1/version" + +require "google/cloud/firestore/v1/firestore/credentials" +require "google/cloud/firestore/v1/firestore/rest/client" + +module Google + module Cloud + module Firestore + module V1 + ## + # The Cloud Firestore service. + # + # Cloud Firestore is a fast, fully managed, serverless, cloud-native NoSQL + # document database that simplifies storing, syncing, and querying data for + # your mobile, web, and IoT apps at global scale. Its client libraries provide + # live synchronization and offline support, while its security features and + # integrations with Firebase and Google Cloud Platform accelerate building + # truly serverless apps. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/firestore/v1/firestore/rest" + # client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + module Firestore + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/firestore/v1/firestore/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb new file mode 100644 index 000000000000..d3785c733a81 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb @@ -0,0 +1,2079 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/firestore/v1/firestore_pb" +require "google/cloud/firestore/v1/firestore/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Firestore + module V1 + module Firestore + module Rest + ## + # REST client for the Firestore service. + # + # The Cloud Firestore service. + # + # Cloud Firestore is a fast, fully managed, serverless, cloud-native NoSQL + # document database that simplifies storing, syncing, and querying data for + # your mobile, web, and IoT apps at global scale. Its client libraries provide + # live synchronization and offline support, while its security features and + # integrations with Firebase and Google Cloud Platform accelerate building + # truly serverless apps. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "firestore.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :firestore_stub + + ## + # Configure the Firestore Client class. + # + # See {::Google::Cloud::Firestore::V1::Firestore::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Firestore clients + # ::Google::Cloud::Firestore::V1::Firestore::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", "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.get_document.timeout = 60.0 + default_config.rpcs.get_document.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + } + + default_config.rpcs.list_documents.timeout = 60.0 + default_config.rpcs.list_documents.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + } + + default_config.rpcs.update_document.timeout = 60.0 + default_config.rpcs.update_document.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14] + } + + default_config.rpcs.delete_document.timeout = 60.0 + default_config.rpcs.delete_document.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + } + + default_config.rpcs.batch_get_documents.timeout = 300.0 + default_config.rpcs.batch_get_documents.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.begin_transaction.timeout = 60.0 + default_config.rpcs.begin_transaction.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + } + + default_config.rpcs.commit.timeout = 60.0 + default_config.rpcs.commit.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14] + } + + default_config.rpcs.rollback.timeout = 60.0 + default_config.rpcs.rollback.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + } + + default_config.rpcs.run_query.timeout = 300.0 + default_config.rpcs.run_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.execute_pipeline.timeout = 300.0 + default_config.rpcs.execute_pipeline.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.run_aggregation_query.timeout = 300.0 + default_config.rpcs.run_aggregation_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.partition_query.timeout = 300.0 + default_config.rpcs.partition_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] + } + + default_config.rpcs.list_collection_ids.timeout = 60.0 + default_config.rpcs.list_collection_ids.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + } + + default_config.rpcs.batch_write.timeout = 60.0 + default_config.rpcs.batch_write.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 10] + } + + default_config.rpcs.create_document.timeout = 60.0 + default_config.rpcs.create_document.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Firestore 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::V1::Firestore::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_stub.universe_domain + end + + ## + # Create a new Firestore REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Firestore 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 + + @firestore_stub = ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @firestore_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @firestore_stub.endpoint + config.universe_domain = @firestore_stub.universe_domain + config.logger = @firestore_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @firestore_stub.logger + end + + # Service calls + + ## + # Gets a single document. + # + # @overload get_document(request, options = nil) + # Pass arguments to `get_document` via a request object, either of type + # {::Google::Cloud::Firestore::V1::GetDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::GetDocumentRequest, ::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_document(name: nil, mask: nil, transaction: nil, read_time: nil) + # Pass arguments to `get_document` 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 resource name of the Document to get. In the format: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] + # The fields to return. If not set, returns all fields. + # + # If the document has a field that is not present in this mask, that field + # will not be returned in the response. + # @param transaction [::String] + # Reads the document in a transaction. + # + # Note: The following parameters are mutually exclusive: `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Reads the version of the document at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following parameters are mutually exclusive: `read_time`, `transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::V1::Document] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::Document] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::GetDocumentRequest.new + # + # # Call the get_document method. + # result = client.get_document request + # + # # The returned object is of type Google::Cloud::Firestore::V1::Document. + # p result + # + def get_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::GetDocumentRequest + + # 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_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_document.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.get_document request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists documents. + # + # @overload list_documents(request, options = nil) + # Pass arguments to `list_documents` via a request object, either of type + # {::Google::Cloud::Firestore::V1::ListDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::ListDocumentsRequest, ::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_documents(parent: nil, collection_id: nil, page_size: nil, page_token: nil, order_by: nil, mask: nil, transaction: nil, read_time: nil, show_missing: nil) + # Pass arguments to `list_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 parent [::String] + # Required. The parent resource name. In the format: + # `projects/{project_id}/databases/{database_id}/documents` or + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # + # For example: + # `projects/my-project/databases/my-database/documents` or + # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + # @param collection_id [::String] + # Optional. The collection ID, relative to `parent`, to list. + # + # For example: `chatrooms` or `messages`. + # + # This is optional, and when not provided, Firestore will list documents + # from all collections under the provided `parent`. + # @param page_size [::Integer] + # Optional. The maximum number of documents to return in a single response. + # + # Firestore may return fewer than this value. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListDocuments` response. + # + # Provide this to retrieve the subsequent page. When paginating, all other + # parameters (with the exception of `page_size`) must match the values set + # in the request that generated the page token. + # @param order_by [::String] + # Optional. The optional ordering of the documents to return. + # + # For example: `priority desc, __name__ desc`. + # + # This mirrors the {::Google::Cloud::Firestore::V1::StructuredQuery#order_by `ORDER BY`} + # used in Firestore queries but in a string representation. When absent, + # documents are ordered based on `__name__ ASC`. + # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] + # Optional. The fields to return. If not set, returns all fields. + # + # If a document has a field that is not present in this mask, that field + # will not be returned in the response. + # @param transaction [::String] + # Perform the read as part of an already active transaction. + # + # Note: The following parameters are mutually exclusive: `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Perform the read at the provided time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following parameters are mutually exclusive: `read_time`, `transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param show_missing [::Boolean] + # If the list should show missing documents. + # + # A document is missing if it does not exist, but there are sub-documents + # nested underneath it. When true, such missing documents will be returned + # with a key but will not have fields, + # {::Google::Cloud::Firestore::V1::Document#create_time `create_time`}, or + # {::Google::Cloud::Firestore::V1::Document#update_time `update_time`} set. + # + # Requests with `show_missing` may not specify `where` or `order_by`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::V1::Document>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::V1::Document>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::ListDocumentsRequest.new + # + # # Call the list_documents method. + # result = client.list_documents 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::V1::Document. + # p item + # end + # + def list_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::ListDocumentsRequest + + # 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_documents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_documents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.list_documents request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @firestore_stub, :list_documents, "documents", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates or inserts a document. + # + # @overload update_document(request, options = nil) + # Pass arguments to `update_document` via a request object, either of type + # {::Google::Cloud::Firestore::V1::UpdateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::UpdateDocumentRequest, ::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_document(document: nil, update_mask: nil, mask: nil, current_document: nil) + # Pass arguments to `update_document` 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 document [::Google::Cloud::Firestore::V1::Document, ::Hash] + # Required. The updated document. + # Creates the document if it does not already exist. + # @param update_mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] + # The fields to update. + # None of the field paths in the mask may contain a reserved name. + # + # If the document exists on the server and has fields not referenced in the + # mask, they are left unchanged. + # Fields referenced in the mask, but not present in the input document, are + # deleted from the document on the server. + # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] + # The fields to return. If not set, returns all fields. + # + # If the document has a field that is not present in this mask, that field + # will not be returned in the response. + # @param current_document [::Google::Cloud::Firestore::V1::Precondition, ::Hash] + # An optional precondition on the document. + # The request will fail if this is set and not met by the target document. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::V1::Document] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::Document] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::UpdateDocumentRequest.new + # + # # Call the update_document method. + # result = client.update_document request + # + # # The returned object is of type Google::Cloud::Firestore::V1::Document. + # p result + # + def update_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::UpdateDocumentRequest + + # 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_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_document.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.update_document request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a document. + # + # @overload delete_document(request, options = nil) + # Pass arguments to `delete_document` via a request object, either of type + # {::Google::Cloud::Firestore::V1::DeleteDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::DeleteDocumentRequest, ::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_document(name: nil, current_document: nil) + # Pass arguments to `delete_document` 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 resource name of the Document to delete. In the format: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # @param current_document [::Google::Cloud::Firestore::V1::Precondition, ::Hash] + # An optional precondition on the document. + # The request will fail if this is set and not met by the target document. + # @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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::DeleteDocumentRequest.new + # + # # Call the delete_document method. + # result = client.delete_document request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::DeleteDocumentRequest + + # 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_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_document.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.delete_document request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets multiple documents. + # + # Documents returned by this method are not guaranteed to be returned in the + # same order that they were requested. + # + # @overload batch_get_documents(request, options = nil) + # Pass arguments to `batch_get_documents` via a request object, either of type + # {::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_get_documents(database: nil, documents: nil, mask: nil, transaction: nil, new_transaction: nil, read_time: nil) + # Pass arguments to `batch_get_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 database [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @param documents [::Array<::String>] + # The names of the documents to retrieve. In the format: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # The request will fail if any of the document is not a child resource of the + # given `database`. Duplicate names will be elided. + # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] + # The fields to return. If not set, returns all fields. + # + # If a document has a field that is not present in this mask, that field will + # not be returned in the response. + # @param transaction [::String] + # Reads documents in a transaction. + # + # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] + # Starts a new transaction and reads the documents. + # Defaults to a read-only transaction. + # The new transaction ID will be returned as the first response in the + # stream. + # + # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Reads documents as they were at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @return [::Enumerable<::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new + # + # # Call the batch_get_documents method to start streaming. + # output = client.batch_get_documents request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse + # output.each do |current_response| + # p current_response + # end + # + def batch_get_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest + + # 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.batch_get_documents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_get_documents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_get_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + ::Gapic::Rest::ServerStream.new( + ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse, + ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| + @firestore_stub.batch_get_documents request, options do |chunk| + in_q.deq + out_q.enq chunk + end + end + ) + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts a new transaction. + # + # @overload begin_transaction(request, options = nil) + # Pass arguments to `begin_transaction` via a request object, either of type + # {::Google::Cloud::Firestore::V1::BeginTransactionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::BeginTransactionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload begin_transaction(database: nil, options: nil) + # Pass arguments to `begin_transaction` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @param options [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] + # The options for the transaction. + # Defaults to a read-write transaction. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::V1::BeginTransactionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::BeginTransactionResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::BeginTransactionRequest.new + # + # # Call the begin_transaction method. + # result = client.begin_transaction request + # + # # The returned object is of type Google::Cloud::Firestore::V1::BeginTransactionResponse. + # p result + # + def begin_transaction request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::BeginTransactionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.begin_transaction.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.begin_transaction.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.begin_transaction.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.begin_transaction request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Commits a transaction, while optionally updating documents. + # + # @overload commit(request, options = nil) + # Pass arguments to `commit` via a request object, either of type + # {::Google::Cloud::Firestore::V1::CommitRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::CommitRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload commit(database: nil, writes: nil, transaction: nil) + # Pass arguments to `commit` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @param writes [::Array<::Google::Cloud::Firestore::V1::Write, ::Hash>] + # The writes to apply. + # + # Always executed atomically and in order. + # @param transaction [::String] + # If set, applies all writes in this transaction, and commits it. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::V1::CommitResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::CommitResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::CommitRequest.new + # + # # Call the commit method. + # result = client.commit request + # + # # The returned object is of type Google::Cloud::Firestore::V1::CommitResponse. + # p result + # + def commit request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::CommitRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.commit.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.commit.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.commit.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.commit request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Rolls back a transaction. + # + # @overload rollback(request, options = nil) + # Pass arguments to `rollback` via a request object, either of type + # {::Google::Cloud::Firestore::V1::RollbackRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::RollbackRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload rollback(database: nil, transaction: nil) + # Pass arguments to `rollback` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @param transaction [::String] + # Required. The transaction to roll back. + # @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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::RollbackRequest.new + # + # # Call the rollback method. + # result = client.rollback request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def rollback request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::RollbackRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.rollback.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.rollback.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.rollback.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.rollback request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Runs a query. + # + # @overload run_query(request, options = nil) + # Pass arguments to `run_query` via a request object, either of type + # {::Google::Cloud::Firestore::V1::RunQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::RunQueryRequest, ::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 run_query(parent: nil, structured_query: nil, transaction: nil, new_transaction: nil, read_time: nil, explain_options: nil) + # Pass arguments to `run_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. In the format: + # `projects/{project_id}/databases/{database_id}/documents` or + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # For example: + # `projects/my-project/databases/my-database/documents` or + # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + # @param structured_query [::Google::Cloud::Firestore::V1::StructuredQuery, ::Hash] + # A structured query. + # @param transaction [::String] + # Run the query within an already active transaction. + # + # The value here is the opaque transaction ID to execute the query in. + # + # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] + # Starts a new transaction and reads the documents. + # Defaults to a read-only transaction. + # The new transaction ID will be returned as the first response in the + # stream. + # + # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Reads documents as they were at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param explain_options [::Google::Cloud::Firestore::V1::ExplainOptions, ::Hash] + # Optional. Explain options for the query. If set, additional query + # statistics will be returned. If not, only query results will be returned. + # @return [::Enumerable<::Google::Cloud::Firestore::V1::RunQueryResponse>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::RunQueryRequest.new + # + # # Call the run_query method to start streaming. + # output = client.run_query request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Firestore::V1::RunQueryResponse + # output.each do |current_response| + # p current_response + # end + # + def run_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::RunQueryRequest + + # 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.run_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.run_query.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.run_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + ::Gapic::Rest::ServerStream.new( + ::Google::Cloud::Firestore::V1::RunQueryResponse, + ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| + @firestore_stub.run_query request, options do |chunk| + in_q.deq + out_q.enq chunk + end + end + ) + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Executes a pipeline query. + # + # @overload execute_pipeline(request, options = nil) + # Pass arguments to `execute_pipeline` via a request object, either of type + # {::Google::Cloud::Firestore::V1::ExecutePipelineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::ExecutePipelineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload execute_pipeline(database: nil, structured_pipeline: nil, transaction: nil, new_transaction: nil, read_time: nil) + # Pass arguments to `execute_pipeline` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. Database identifier, in the form + # `projects/{project}/databases/{database}`. + # @param structured_pipeline [::Google::Cloud::Firestore::V1::StructuredPipeline, ::Hash] + # A pipelined operation. + # @param transaction [::String] + # Run the query within an already active transaction. + # + # The value here is the opaque transaction ID to execute the query in. + # + # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] + # Execute the pipeline in a new transaction. + # + # The identifier of the newly created transaction will be returned in the + # first response on the stream. This defaults to a read-only transaction. + # + # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Execute the pipeline in a snapshot transaction at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @return [::Enumerable<::Google::Cloud::Firestore::V1::ExecutePipelineResponse>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::ExecutePipelineRequest.new + # + # # Call the execute_pipeline method to start streaming. + # output = client.execute_pipeline request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Firestore::V1::ExecutePipelineResponse + # output.each do |current_response| + # p current_response + # end + # + def execute_pipeline request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::ExecutePipelineRequest + + # 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.execute_pipeline.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.execute_pipeline.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.execute_pipeline.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + ::Gapic::Rest::ServerStream.new( + ::Google::Cloud::Firestore::V1::ExecutePipelineResponse, + ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| + @firestore_stub.execute_pipeline request, options do |chunk| + in_q.deq + out_q.enq chunk + end + end + ) + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Runs an aggregation query. + # + # Rather than producing {::Google::Cloud::Firestore::V1::Document Document} results like + # {::Google::Cloud::Firestore::V1::Firestore::Rest::Client#run_query Firestore.RunQuery}, this API + # allows running an aggregation to produce a series of + # {::Google::Cloud::Firestore::V1::AggregationResult AggregationResult} server-side. + # + # High-Level Example: + # + # ``` + # -- Return the number of documents in table given a filter. + # SELECT COUNT(*) FROM ( SELECT * FROM k where a = true ); + # ``` + # + # @overload run_aggregation_query(request, options = nil) + # Pass arguments to `run_aggregation_query` via a request object, either of type + # {::Google::Cloud::Firestore::V1::RunAggregationQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::RunAggregationQueryRequest, ::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 run_aggregation_query(parent: nil, structured_aggregation_query: nil, transaction: nil, new_transaction: nil, read_time: nil, explain_options: nil) + # Pass arguments to `run_aggregation_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. In the format: + # `projects/{project_id}/databases/{database_id}/documents` or + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # For example: + # `projects/my-project/databases/my-database/documents` or + # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + # @param structured_aggregation_query [::Google::Cloud::Firestore::V1::StructuredAggregationQuery, ::Hash] + # An aggregation query. + # @param transaction [::String] + # Run the aggregation within an already active transaction. + # + # The value here is the opaque transaction ID to execute the query in. + # + # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] + # Starts a new transaction as part of the query, defaulting to read-only. + # + # The new transaction ID will be returned as the first response in the + # stream. + # + # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Executes the query at the given timestamp. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param explain_options [::Google::Cloud::Firestore::V1::ExplainOptions, ::Hash] + # Optional. Explain options for the query. If set, additional query + # statistics will be returned. If not, only query results will be returned. + # @return [::Enumerable<::Google::Cloud::Firestore::V1::RunAggregationQueryResponse>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new + # + # # Call the run_aggregation_query method to start streaming. + # output = client.run_aggregation_query request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse + # output.each do |current_response| + # p current_response + # end + # + def run_aggregation_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::RunAggregationQueryRequest + + # 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.run_aggregation_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.run_aggregation_query.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.run_aggregation_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + ::Gapic::Rest::ServerStream.new( + ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse, + ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| + @firestore_stub.run_aggregation_query request, options do |chunk| + in_q.deq + out_q.enq chunk + end + end + ) + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Partitions a query by returning partition cursors that can be used to run + # the query in parallel. The returned partition cursors are split points that + # can be used by RunQuery as starting/end points for the query results. + # + # @overload partition_query(request, options = nil) + # Pass arguments to `partition_query` via a request object, either of type + # {::Google::Cloud::Firestore::V1::PartitionQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::PartitionQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload partition_query(parent: nil, structured_query: nil, partition_count: nil, page_token: nil, page_size: nil, read_time: nil) + # Pass arguments to `partition_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. In the format: + # `projects/{project_id}/databases/{database_id}/documents`. + # Document resource names are not supported; only database resource names + # can be specified. + # @param structured_query [::Google::Cloud::Firestore::V1::StructuredQuery, ::Hash] + # A structured query. + # Query must specify collection with all descendants and be ordered by name + # ascending. Other filters, order bys, limits, offsets, and start/end + # cursors are not supported. + # @param partition_count [::Integer] + # The desired maximum number of partition points. + # The partitions may be returned across multiple pages of results. + # The number must be positive. The actual number of partitions + # returned may be fewer. + # + # For example, this may be set to one fewer than the number of parallel + # queries to be run, or in running a data pipeline job, one fewer than the + # number of workers or compute instances available. + # @param page_token [::String] + # The `next_page_token` value returned from a previous call to + # PartitionQuery that may be used to get an additional set of results. + # There are no ordering guarantees between sets of results. Thus, using + # multiple sets of results will require merging the different result sets. + # + # For example, two subsequent calls using a page_token may return: + # + # * cursor B, cursor M, cursor Q + # * cursor A, cursor U, cursor W + # + # To obtain a complete result set ordered with respect to the results of the + # query supplied to PartitionQuery, the results sets should be merged: + # cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W + # @param page_size [::Integer] + # The maximum number of partitions to return in this call, subject to + # `partition_count`. + # + # For example, if `partition_count` = 10 and `page_size` = 8, the first call + # to PartitionQuery will return up to 8 partitions and a `next_page_token` + # if more results exist. A second call to PartitionQuery will return up to + # 2 partitions, to complete the total of 10 specified in `partition_count`. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Reads documents as they were at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::V1::Cursor>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::V1::Cursor>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::PartitionQueryRequest.new + # + # # Call the partition_query method. + # result = client.partition_query 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::V1::Cursor. + # p item + # end + # + def partition_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::PartitionQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.partition_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.partition_query.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.partition_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.partition_query request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @firestore_stub, :partition_query, "partitions", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the collection IDs underneath a document. + # + # @overload list_collection_ids(request, options = nil) + # Pass arguments to `list_collection_ids` via a request object, either of type + # {::Google::Cloud::Firestore::V1::ListCollectionIdsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::ListCollectionIdsRequest, ::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_collection_ids(parent: nil, page_size: nil, page_token: nil, read_time: nil) + # Pass arguments to `list_collection_ids` 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 document. In the format: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # For example: + # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + # @param page_size [::Integer] + # The maximum number of results to return. + # @param page_token [::String] + # A page token. Must be a value from + # {::Google::Cloud::Firestore::V1::ListCollectionIdsResponse ListCollectionIdsResponse}. + # @param read_time [::Google::Protobuf::Timestamp, ::Hash] + # Reads documents as they were at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::V1::ListCollectionIdsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::ListCollectionIdsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new + # + # # Call the list_collection_ids method. + # result = client.list_collection_ids request + # + # # The returned object is of type Google::Cloud::Firestore::V1::ListCollectionIdsResponse. + # p result + # + def list_collection_ids request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::ListCollectionIdsRequest + + # 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_collection_ids.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_collection_ids.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_collection_ids.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.list_collection_ids request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Applies a batch of write operations. + # + # The BatchWrite method does not apply the write operations atomically + # and can apply them out of order. Method does not allow more than one write + # per document. Each write succeeds or fails independently. See the + # {::Google::Cloud::Firestore::V1::BatchWriteResponse BatchWriteResponse} for the + # success status of each write. + # + # If you require an atomically applied set of writes, use + # {::Google::Cloud::Firestore::V1::Firestore::Rest::Client#commit Commit} instead. + # + # @overload batch_write(request, options = nil) + # Pass arguments to `batch_write` via a request object, either of type + # {::Google::Cloud::Firestore::V1::BatchWriteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::BatchWriteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_write(database: nil, writes: nil, labels: nil) + # Pass arguments to `batch_write` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param database [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @param writes [::Array<::Google::Cloud::Firestore::V1::Write, ::Hash>] + # The writes to apply. + # + # Method does not apply writes atomically and does not guarantee ordering. + # Each write succeeds or fails independently. You cannot write to the same + # document more than once per request. + # @param labels [::Hash{::String => ::String}] + # Labels associated with this batch write. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::V1::BatchWriteResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::BatchWriteResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::BatchWriteRequest.new + # + # # Call the batch_write method. + # result = client.batch_write request + # + # # The returned object is of type Google::Cloud::Firestore::V1::BatchWriteResponse. + # p result + # + def batch_write request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::BatchWriteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.batch_write.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_write.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_write.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.batch_write request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new document. + # + # @overload create_document(request, options = nil) + # Pass arguments to `create_document` via a request object, either of type + # {::Google::Cloud::Firestore::V1::CreateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Firestore::V1::CreateDocumentRequest, ::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_document(parent: nil, collection_id: nil, document_id: nil, document: nil, mask: nil) + # Pass arguments to `create_document` 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 resource. For example: + # `projects/{project_id}/databases/{database_id}/documents` or + # `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + # @param collection_id [::String] + # Required. The collection ID, relative to `parent`, to list. For example: + # `chatrooms`. + # @param document_id [::String] + # The client-assigned document ID to use for this document. + # + # Optional. If not specified, an ID will be assigned by the service. + # @param document [::Google::Cloud::Firestore::V1::Document, ::Hash] + # Required. The document to create. `name` must not be set. + # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] + # The fields to return. If not set, returns all fields. + # + # If the document has a field that is not present in this mask, that field + # will not be returned in the response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Firestore::V1::Document] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::Document] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/firestore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Firestore::V1::CreateDocumentRequest.new + # + # # Call the create_document method. + # result = client.create_document request + # + # # The returned object is of type Google::Cloud::Firestore::V1::Document. + # p result + # + def create_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::CreateDocumentRequest + + # 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_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Firestore::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_document.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @firestore_stub.create_document request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Firestore REST API. + # + # This class represents the configuration for Firestore 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::V1::Firestore::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 + # # get_document to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_document.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_document.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "firestore.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Firestore 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 `get_document` + # @return [::Gapic::Config::Method] + # + attr_reader :get_document + ## + # RPC-specific configuration for `list_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :list_documents + ## + # RPC-specific configuration for `update_document` + # @return [::Gapic::Config::Method] + # + attr_reader :update_document + ## + # RPC-specific configuration for `delete_document` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_document + ## + # RPC-specific configuration for `batch_get_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_get_documents + ## + # RPC-specific configuration for `begin_transaction` + # @return [::Gapic::Config::Method] + # + attr_reader :begin_transaction + ## + # RPC-specific configuration for `commit` + # @return [::Gapic::Config::Method] + # + attr_reader :commit + ## + # RPC-specific configuration for `rollback` + # @return [::Gapic::Config::Method] + # + attr_reader :rollback + ## + # RPC-specific configuration for `run_query` + # @return [::Gapic::Config::Method] + # + attr_reader :run_query + ## + # RPC-specific configuration for `execute_pipeline` + # @return [::Gapic::Config::Method] + # + attr_reader :execute_pipeline + ## + # RPC-specific configuration for `run_aggregation_query` + # @return [::Gapic::Config::Method] + # + attr_reader :run_aggregation_query + ## + # RPC-specific configuration for `partition_query` + # @return [::Gapic::Config::Method] + # + attr_reader :partition_query + ## + # RPC-specific configuration for `list_collection_ids` + # @return [::Gapic::Config::Method] + # + attr_reader :list_collection_ids + ## + # RPC-specific configuration for `batch_write` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_write + ## + # RPC-specific configuration for `create_document` + # @return [::Gapic::Config::Method] + # + attr_reader :create_document + + # @private + def initialize parent_rpcs = nil + get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document + @get_document = ::Gapic::Config::Method.new get_document_config + list_documents_config = parent_rpcs.list_documents if parent_rpcs.respond_to? :list_documents + @list_documents = ::Gapic::Config::Method.new list_documents_config + update_document_config = parent_rpcs.update_document if parent_rpcs.respond_to? :update_document + @update_document = ::Gapic::Config::Method.new update_document_config + delete_document_config = parent_rpcs.delete_document if parent_rpcs.respond_to? :delete_document + @delete_document = ::Gapic::Config::Method.new delete_document_config + batch_get_documents_config = parent_rpcs.batch_get_documents if parent_rpcs.respond_to? :batch_get_documents + @batch_get_documents = ::Gapic::Config::Method.new batch_get_documents_config + begin_transaction_config = parent_rpcs.begin_transaction if parent_rpcs.respond_to? :begin_transaction + @begin_transaction = ::Gapic::Config::Method.new begin_transaction_config + commit_config = parent_rpcs.commit if parent_rpcs.respond_to? :commit + @commit = ::Gapic::Config::Method.new commit_config + rollback_config = parent_rpcs.rollback if parent_rpcs.respond_to? :rollback + @rollback = ::Gapic::Config::Method.new rollback_config + run_query_config = parent_rpcs.run_query if parent_rpcs.respond_to? :run_query + @run_query = ::Gapic::Config::Method.new run_query_config + execute_pipeline_config = parent_rpcs.execute_pipeline if parent_rpcs.respond_to? :execute_pipeline + @execute_pipeline = ::Gapic::Config::Method.new execute_pipeline_config + run_aggregation_query_config = parent_rpcs.run_aggregation_query if parent_rpcs.respond_to? :run_aggregation_query + @run_aggregation_query = ::Gapic::Config::Method.new run_aggregation_query_config + partition_query_config = parent_rpcs.partition_query if parent_rpcs.respond_to? :partition_query + @partition_query = ::Gapic::Config::Method.new partition_query_config + list_collection_ids_config = parent_rpcs.list_collection_ids if parent_rpcs.respond_to? :list_collection_ids + @list_collection_ids = ::Gapic::Config::Method.new list_collection_ids_config + batch_write_config = parent_rpcs.batch_write if parent_rpcs.respond_to? :batch_write + @batch_write = ::Gapic::Config::Method.new batch_write_config + create_document_config = parent_rpcs.create_document if parent_rpcs.respond_to? :create_document + @create_document = ::Gapic::Config::Method.new create_document_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-v1/lib/google/cloud/firestore/v1/firestore/rest/service_stub.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/service_stub.rb new file mode 100644 index 000000000000..0cac6fe2306c --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/service_stub.rb @@ -0,0 +1,1026 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/firestore/v1/firestore_pb" + +module Google + module Cloud + module Firestore + module V1 + module Firestore + module Rest + ## + # REST service stub for the Firestore service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_document REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::GetDocumentRequest] + # 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::V1::Document] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::Document] + # A result object deserialized from the server's reply + def get_document request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_document_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_document", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::V1::Document.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_documents REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::ListDocumentsRequest] + # 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::V1::ListDocumentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::ListDocumentsResponse] + # A result object deserialized from the server's reply + def list_documents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_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, + method_name: "list_documents", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::V1::ListDocumentsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_document REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::UpdateDocumentRequest] + # 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::V1::Document] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::Document] + # A result object deserialized from the server's reply + def update_document request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_document_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_document", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::V1::Document.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_document REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::DeleteDocumentRequest] + # 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_document request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_document_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_document", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_get_documents REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest] + # 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. + # + # @yieldparam chunk [::String] The chunk of data received during server streaming. + # + # @return [::Gapic::Rest::TransportOperation] + def batch_get_documents(request_pb, options = nil, &) + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_get_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, + method_name: "batch_get_documents", + options: options, + is_server_streaming: true, + & + ) + ::Gapic::Rest::TransportOperation.new response + end + + ## + # Baseline implementation for the begin_transaction REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::BeginTransactionRequest] + # 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::V1::BeginTransactionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::BeginTransactionResponse] + # A result object deserialized from the server's reply + def begin_transaction request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_begin_transaction_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "begin_transaction", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::V1::BeginTransactionResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the commit REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::CommitRequest] + # 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::V1::CommitResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::CommitResponse] + # A result object deserialized from the server's reply + def commit request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_commit_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "commit", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::V1::CommitResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the rollback REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::RollbackRequest] + # 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 rollback request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_rollback_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "rollback", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the run_query REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::RunQueryRequest] + # 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. + # + # @yieldparam chunk [::String] The chunk of data received during server streaming. + # + # @return [::Gapic::Rest::TransportOperation] + def run_query(request_pb, options = nil, &) + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_run_query_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "run_query", + options: options, + is_server_streaming: true, + & + ) + ::Gapic::Rest::TransportOperation.new response + end + + ## + # Baseline implementation for the execute_pipeline REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::ExecutePipelineRequest] + # 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. + # + # @yieldparam chunk [::String] The chunk of data received during server streaming. + # + # @return [::Gapic::Rest::TransportOperation] + def execute_pipeline(request_pb, options = nil, &) + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_execute_pipeline_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "execute_pipeline", + options: options, + is_server_streaming: true, + & + ) + ::Gapic::Rest::TransportOperation.new response + end + + ## + # Baseline implementation for the run_aggregation_query REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::RunAggregationQueryRequest] + # 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. + # + # @yieldparam chunk [::String] The chunk of data received during server streaming. + # + # @return [::Gapic::Rest::TransportOperation] + def run_aggregation_query(request_pb, options = nil, &) + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_run_aggregation_query_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "run_aggregation_query", + options: options, + is_server_streaming: true, + & + ) + ::Gapic::Rest::TransportOperation.new response + end + + ## + # Baseline implementation for the partition_query REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::PartitionQueryRequest] + # 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::V1::PartitionQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::PartitionQueryResponse] + # A result object deserialized from the server's reply + def partition_query request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_partition_query_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "partition_query", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::V1::PartitionQueryResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_collection_ids REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::ListCollectionIdsRequest] + # 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::V1::ListCollectionIdsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::ListCollectionIdsResponse] + # A result object deserialized from the server's reply + def list_collection_ids request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_collection_ids_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_collection_ids", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::V1::ListCollectionIdsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_write REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::BatchWriteRequest] + # 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::V1::BatchWriteResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::BatchWriteResponse] + # A result object deserialized from the server's reply + def batch_write request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_write_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "batch_write", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::V1::BatchWriteResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_document REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::CreateDocumentRequest] + # 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::V1::Document] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Firestore::V1::Document] + # A result object deserialized from the server's reply + def create_document request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_document_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_document", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Firestore::V1::Document.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the get_document REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::GetDocumentRequest] + # 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_document_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_documents REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::ListDocumentsRequest] + # 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_documents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/{collection_id}", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true], + ["collection_id", %r{^[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/{collection_id}", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/?$}, false], + ["collection_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_document REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::UpdateDocumentRequest] + # 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_document_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{document.name}", + body: "document", + matches: [ + ["document.name", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_document REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::DeleteDocumentRequest] + # 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_document_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_get_documents REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_get_documents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{database}/documents:batchGet", + body: "*", + matches: [ + ["database", %r{^projects/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the begin_transaction REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::BeginTransactionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_begin_transaction_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{database}/documents:beginTransaction", + body: "*", + matches: [ + ["database", %r{^projects/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the commit REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::CommitRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_commit_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{database}/documents:commit", + body: "*", + matches: [ + ["database", %r{^projects/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the rollback REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::RollbackRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_rollback_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{database}/documents:rollback", + body: "*", + matches: [ + ["database", %r{^projects/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_query REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::RunQueryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_run_query_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:runQuery", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:runQuery", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the execute_pipeline REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::ExecutePipelineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_execute_pipeline_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{database}/documents:executePipeline", + body: "*", + matches: [ + ["database", %r{^projects/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_aggregation_query REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::RunAggregationQueryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_run_aggregation_query_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:runAggregationQuery", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:runAggregationQuery", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the partition_query REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::PartitionQueryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_partition_query_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:partitionQuery", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:partitionQuery", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_collection_ids REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::ListCollectionIdsRequest] + # 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_collection_ids_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:listCollectionIds", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:listCollectionIds", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_write REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::BatchWriteRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_write_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{database}/documents:batchWrite", + body: "*", + matches: [ + ["database", %r{^projects/[^/]+/databases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_document REST call + # + # @param request_pb [::Google::Cloud::Firestore::V1::CreateDocumentRequest] + # 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_document_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/{collection_id}", + body: "document", + matches: [ + ["parent", %r{^projects/[^/]+/databases/[^/]+/documents(?:/.*)?$}, true], + ["collection_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/rest.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/rest.rb new file mode 100644 index 000000000000..8498e99136a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/rest.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/firestore/v1/firestore/rest" +require "google/cloud/firestore/v1/version" + +module Google + module Cloud + module Firestore + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/firestore/v1/rest" + # client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/version.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/version.rb new file mode 100644 index 000000000000..6398d674ba15 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Firestore + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/aggregation_result_pb.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/aggregation_result_pb.rb new file mode 100644 index 000000000000..910e6f9fe80f --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/aggregation_result_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/firestore/v1/aggregation_result.proto + +require 'google/protobuf' + +require 'google/firestore/v1/document_pb' + + +descriptor_data = "\n,google/firestore/v1/aggregation_result.proto\x12\x13google.firestore.v1\x1a\"google/firestore/v1/document.proto\"\xbe\x01\n\x11\x41ggregationResult\x12U\n\x10\x61ggregate_fields\x18\x02 \x03(\x0b\x32;.google.firestore.v1.AggregationResult.AggregateFieldsEntry\x1aR\n\x14\x41ggregateFieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\x42\xce\x01\n\x17\x63om.google.firestore.v1B\x16\x41ggregationResultProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::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.v1.Value", "google/firestore/v1/document.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 V1 + AggregationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.AggregationResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/bloom_filter_pb.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/bloom_filter_pb.rb new file mode 100644 index 000000000000..a633a3ae5e40 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/bloom_filter_pb.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/firestore/v1/bloom_filter.proto + +require 'google/protobuf' + + +descriptor_data = "\n&google/firestore/v1/bloom_filter.proto\x12\x13google.firestore.v1\".\n\x0b\x42itSequence\x12\x0e\n\x06\x62itmap\x18\x01 \x01(\x0c\x12\x0f\n\x07padding\x18\x02 \x01(\x05\"Q\n\x0b\x42loomFilter\x12.\n\x04\x62its\x18\x01 \x01(\x0b\x32 .google.firestore.v1.BitSequence\x12\x12\n\nhash_count\x18\x02 \x01(\x05\x42\xc8\x01\n\x17\x63om.google.firestore.v1B\x10\x42loomFilterProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::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 V1 + BitSequence = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.BitSequence").msgclass + BloomFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.BloomFilter").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/common_pb.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/common_pb.rb new file mode 100644 index 000000000000..e8950cc89c76 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/common_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/firestore/v1/common.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n google/firestore/v1/common.proto\x12\x13google.firestore.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"#\n\x0c\x44ocumentMask\x12\x13\n\x0b\x66ield_paths\x18\x01 \x03(\t\"e\n\x0cPrecondition\x12\x10\n\x06\x65xists\x18\x01 \x01(\x08H\x00\x12\x31\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x10\n\x0e\x63ondition_type\"\xa9\x02\n\x12TransactionOptions\x12\x45\n\tread_only\x18\x02 \x01(\x0b\x32\x30.google.firestore.v1.TransactionOptions.ReadOnlyH\x00\x12G\n\nread_write\x18\x03 \x01(\x0b\x32\x31.google.firestore.v1.TransactionOptions.ReadWriteH\x00\x1a&\n\tReadWrite\x12\x19\n\x11retry_transaction\x18\x01 \x01(\x0c\x1aS\n\x08ReadOnly\x12/\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x16\n\x14\x63onsistency_selectorB\x06\n\x04modeB\xc3\x01\n\x17\x63om.google.firestore.v1B\x0b\x43ommonProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::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 V1 + DocumentMask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.DocumentMask").msgclass + Precondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.Precondition").msgclass + TransactionOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.TransactionOptions").msgclass + TransactionOptions::ReadWrite = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.TransactionOptions.ReadWrite").msgclass + TransactionOptions::ReadOnly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.TransactionOptions.ReadOnly").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/document_pb.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/document_pb.rb new file mode 100644 index 000000000000..8cf9b80c1e28 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/document_pb.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/firestore/v1/document.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/type/latlng_pb' + + +descriptor_data = "\n\"google/firestore/v1/document.proto\x12\x13google.firestore.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x18google/type/latlng.proto\"\x80\x02\n\x08\x44ocument\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x39\n\x06\x66ields\x18\x02 \x03(\x0b\x32).google.firestore.v1.Document.FieldsEntry\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aI\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\"\xe5\x04\n\x05Value\x12\x30\n\nnull_value\x18\x0b \x01(\x0e\x32\x1a.google.protobuf.NullValueH\x00\x12\x17\n\rboolean_value\x18\x01 \x01(\x08H\x00\x12\x17\n\rinteger_value\x18\x02 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x03 \x01(\x01H\x00\x12\x35\n\x0ftimestamp_value\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x16\n\x0cstring_value\x18\x11 \x01(\tH\x00\x12\x15\n\x0b\x62ytes_value\x18\x12 \x01(\x0cH\x00\x12\x19\n\x0freference_value\x18\x05 \x01(\tH\x00\x12.\n\x0fgeo_point_value\x18\x08 \x01(\x0b\x32\x13.google.type.LatLngH\x00\x12\x36\n\x0b\x61rray_value\x18\t \x01(\x0b\x32\x1f.google.firestore.v1.ArrayValueH\x00\x12\x32\n\tmap_value\x18\x06 \x01(\x0b\x32\x1d.google.firestore.v1.MapValueH\x00\x12\x1f\n\x15\x66ield_reference_value\x18\x13 \x01(\tH\x00\x12\"\n\x18variable_reference_value\x18\x16 \x01(\tH\x00\x12\x37\n\x0e\x66unction_value\x18\x14 \x01(\x0b\x32\x1d.google.firestore.v1.FunctionH\x00\x12\x37\n\x0epipeline_value\x18\x15 \x01(\x0b\x32\x1d.google.firestore.v1.PipelineH\x00\x42\x0c\n\nvalue_type\"8\n\nArrayValue\x12*\n\x06values\x18\x01 \x03(\x0b\x32\x1a.google.firestore.v1.Value\"\x90\x01\n\x08MapValue\x12\x39\n\x06\x66ields\x18\x01 \x03(\x0b\x32).google.firestore.v1.MapValue.FieldsEntry\x1aI\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\"\xda\x01\n\x08\x46unction\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12-\n\x04\x61rgs\x18\x02 \x03(\x0b\x32\x1a.google.firestore.v1.ValueB\x03\xe0\x41\x01\x12@\n\x07options\x18\x03 \x03(\x0b\x32*.google.firestore.v1.Function.OptionsEntryB\x03\xe0\x41\x01\x1aJ\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\"\xa4\x02\n\x08Pipeline\x12\x38\n\x06stages\x18\x01 \x03(\x0b\x32#.google.firestore.v1.Pipeline.StageB\x03\xe0\x41\x02\x1a\xdd\x01\n\x05Stage\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12-\n\x04\x61rgs\x18\x02 \x03(\x0b\x32\x1a.google.firestore.v1.ValueB\x03\xe0\x41\x01\x12\x46\n\x07options\x18\x03 \x03(\x0b\x32\x30.google.firestore.v1.Pipeline.Stage.OptionsEntryB\x03\xe0\x41\x01\x1aJ\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\x42\xc5\x01\n\x17\x63om.google.firestore.v1B\rDocumentProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::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.type.LatLng", "google/type/latlng.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 V1 + Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.Document").msgclass + Value = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.Value").msgclass + ArrayValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.ArrayValue").msgclass + MapValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.MapValue").msgclass + Function = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.Function").msgclass + Pipeline = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.Pipeline").msgclass + Pipeline::Stage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.Pipeline.Stage").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/explain_stats_pb.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/explain_stats_pb.rb new file mode 100644 index 000000000000..8502d71e7acf --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/explain_stats_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/firestore/v1/explain_stats.proto + +require 'google/protobuf' + +require 'google/protobuf/any_pb' + + +descriptor_data = "\n\'google/firestore/v1/explain_stats.proto\x12\x13google.firestore.v1\x1a\x19google/protobuf/any.proto\"2\n\x0c\x45xplainStats\x12\"\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x14.google.protobuf.AnyB\xc2\x01\n\x17\x63om.google.firestore.v1B\x11\x45xplainStatsProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::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.Any", "google/protobuf/any.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 V1 + ExplainStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.ExplainStats").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/firestore_pb.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/firestore_pb.rb new file mode 100644 index 000000000000..ac0e1b9e7e37 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/firestore_pb.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/firestore/v1/firestore.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/routing_pb' +require 'google/firestore/v1/aggregation_result_pb' +require 'google/firestore/v1/common_pb' +require 'google/firestore/v1/document_pb' +require 'google/firestore/v1/explain_stats_pb' +require 'google/firestore/v1/pipeline_pb' +require 'google/firestore/v1/query_pb' +require 'google/firestore/v1/query_profile_pb' +require 'google/firestore/v1/write_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n#google/firestore/v1/firestore.proto\x12\x13google.firestore.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x18google/api/routing.proto\x1a,google/firestore/v1/aggregation_result.proto\x1a google/firestore/v1/common.proto\x1a\"google/firestore/v1/document.proto\x1a\'google/firestore/v1/explain_stats.proto\x1a\"google/firestore/v1/pipeline.proto\x1a\x1fgoogle/firestore/v1/query.proto\x1a\'google/firestore/v1/query_profile.proto\x1a\x1fgoogle/firestore/v1/write.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x17google/rpc/status.proto\"\xb8\x01\n\x12GetDocumentRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12/\n\x04mask\x18\x02 \x01(\x0b\x32!.google.firestore.v1.DocumentMask\x12\x15\n\x0btransaction\x18\x03 \x01(\x0cH\x00\x12/\n\tread_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x16\n\x14\x63onsistency_selector\"\xbb\x02\n\x14ListDocumentsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rcollection_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x04mask\x18\x07 \x01(\x0b\x32!.google.firestore.v1.DocumentMaskB\x03\xe0\x41\x01\x12\x15\n\x0btransaction\x18\x08 \x01(\x0cH\x00\x12/\n\tread_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x14\n\x0cshow_missing\x18\x0c \x01(\x08\x42\x16\n\x14\x63onsistency_selector\"b\n\x15ListDocumentsResponse\x12\x30\n\tdocuments\x18\x01 \x03(\x0b\x32\x1d.google.firestore.v1.Document\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xc4\x01\n\x15\x43reateDocumentRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rcollection_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64ocument_id\x18\x03 \x01(\t\x12\x34\n\x08\x64ocument\x18\x04 \x01(\x0b\x32\x1d.google.firestore.v1.DocumentB\x03\xe0\x41\x02\x12/\n\x04mask\x18\x05 \x01(\x0b\x32!.google.firestore.v1.DocumentMask\"\xf3\x01\n\x15UpdateDocumentRequest\x12\x34\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\x1d.google.firestore.v1.DocumentB\x03\xe0\x41\x02\x12\x36\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32!.google.firestore.v1.DocumentMask\x12/\n\x04mask\x18\x03 \x01(\x0b\x32!.google.firestore.v1.DocumentMask\x12;\n\x10\x63urrent_document\x18\x04 \x01(\x0b\x32!.google.firestore.v1.Precondition\"g\n\x15\x44\x65leteDocumentRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12;\n\x10\x63urrent_document\x18\x02 \x01(\x0b\x32!.google.firestore.v1.Precondition\"\x99\x02\n\x18\x42\x61tchGetDocumentsRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tdocuments\x18\x02 \x03(\t\x12/\n\x04mask\x18\x03 \x01(\x0b\x32!.google.firestore.v1.DocumentMask\x12\x15\n\x0btransaction\x18\x04 \x01(\x0cH\x00\x12\x42\n\x0fnew_transaction\x18\x05 \x01(\x0b\x32\'.google.firestore.v1.TransactionOptionsH\x00\x12/\n\tread_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x16\n\x14\x63onsistency_selector\"\xac\x01\n\x19\x42\x61tchGetDocumentsResponse\x12.\n\x05\x66ound\x18\x01 \x01(\x0b\x32\x1d.google.firestore.v1.DocumentH\x00\x12\x11\n\x07missing\x18\x02 \x01(\tH\x00\x12\x13\n\x0btransaction\x18\x03 \x01(\x0c\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x08\n\x06result\"j\n\x17\x42\x65ginTransactionRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x38\n\x07options\x18\x02 \x01(\x0b\x32\'.google.firestore.v1.TransactionOptions\"/\n\x18\x42\x65ginTransactionResponse\x12\x13\n\x0btransaction\x18\x01 \x01(\x0c\"g\n\rCommitRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12*\n\x06writes\x18\x02 \x03(\x0b\x32\x1a.google.firestore.v1.Write\x12\x13\n\x0btransaction\x18\x03 \x01(\x0c\"z\n\x0e\x43ommitResponse\x12\x37\n\rwrite_results\x18\x01 \x03(\x0b\x32 .google.firestore.v1.WriteResult\x12/\n\x0b\x63ommit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"B\n\x0fRollbackRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0btransaction\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\"\xdd\x02\n\x0fRunQueryRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12@\n\x10structured_query\x18\x02 \x01(\x0b\x32$.google.firestore.v1.StructuredQueryH\x00\x12\x15\n\x0btransaction\x18\x05 \x01(\x0cH\x01\x12\x42\n\x0fnew_transaction\x18\x06 \x01(\x0b\x32\'.google.firestore.v1.TransactionOptionsH\x01\x12/\n\tread_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12\x41\n\x0f\x65xplain_options\x18\n \x01(\x0b\x32#.google.firestore.v1.ExplainOptionsB\x03\xe0\x41\x01\x42\x0c\n\nquery_typeB\x16\n\x14\x63onsistency_selector\"\x87\x02\n\x10RunQueryResponse\x12\x13\n\x0btransaction\x18\x02 \x01(\x0c\x12/\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\x1d.google.firestore.v1.Document\x12-\n\tread_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fskipped_results\x18\x04 \x01(\x05\x12\x0e\n\x04\x64one\x18\x06 \x01(\x08H\x00\x12<\n\x0f\x65xplain_metrics\x18\x0b \x01(\x0b\x32#.google.firestore.v1.ExplainMetricsB\x17\n\x15\x63ontinuation_selector\"\xac\x02\n\x16\x45xecutePipelineRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x46\n\x13structured_pipeline\x18\x02 \x01(\x0b\x32\'.google.firestore.v1.StructuredPipelineH\x00\x12\x15\n\x0btransaction\x18\x05 \x01(\x0cH\x01\x12\x42\n\x0fnew_transaction\x18\x06 \x01(\x0b\x32\'.google.firestore.v1.TransactionOptionsH\x01\x12/\n\tread_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x42\x0f\n\rpipeline_typeB\x16\n\x14\x63onsistency_selector\"\xcc\x01\n\x17\x45xecutePipelineResponse\x12\x13\n\x0btransaction\x18\x01 \x01(\x0c\x12.\n\x07results\x18\x02 \x03(\x0b\x32\x1d.google.firestore.v1.Document\x12\x32\n\x0e\x65xecution_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\rexplain_stats\x18\x04 \x01(\x0b\x32!.google.firestore.v1.ExplainStats\"\xff\x02\n\x1aRunAggregationQueryRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12W\n\x1cstructured_aggregation_query\x18\x02 \x01(\x0b\x32/.google.firestore.v1.StructuredAggregationQueryH\x00\x12\x15\n\x0btransaction\x18\x04 \x01(\x0cH\x01\x12\x42\n\x0fnew_transaction\x18\x05 \x01(\x0b\x32\'.google.firestore.v1.TransactionOptionsH\x01\x12/\n\tread_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12\x41\n\x0f\x65xplain_options\x18\x08 \x01(\x0b\x32#.google.firestore.v1.ExplainOptionsB\x03\xe0\x41\x01\x42\x0c\n\nquery_typeB\x16\n\x14\x63onsistency_selector\"\xd7\x01\n\x1bRunAggregationQueryResponse\x12\x36\n\x06result\x18\x01 \x01(\x0b\x32&.google.firestore.v1.AggregationResult\x12\x13\n\x0btransaction\x18\x02 \x01(\x0c\x12-\n\tread_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x0f\x65xplain_metrics\x18\n \x01(\x0b\x32#.google.firestore.v1.ExplainMetrics\"\x85\x02\n\x15PartitionQueryRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12@\n\x10structured_query\x18\x02 \x01(\x0b\x32$.google.firestore.v1.StructuredQueryH\x00\x12\x17\n\x0fpartition_count\x18\x03 \x01(\x03\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x11\n\tpage_size\x18\x05 \x01(\x05\x12/\n\tread_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x42\x0c\n\nquery_typeB\x16\n\x14\x63onsistency_selector\"b\n\x16PartitionQueryResponse\x12/\n\npartitions\x18\x01 \x03(\x0b\x32\x1b.google.firestore.v1.Cursor\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xe8\x01\n\x0cWriteRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tstream_id\x18\x02 \x01(\t\x12*\n\x06writes\x18\x03 \x03(\x0b\x32\x1a.google.firestore.v1.Write\x12\x14\n\x0cstream_token\x18\x04 \x01(\x0c\x12=\n\x06labels\x18\x05 \x03(\x0b\x32-.google.firestore.v1.WriteRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xa2\x01\n\rWriteResponse\x12\x11\n\tstream_id\x18\x01 \x01(\t\x12\x14\n\x0cstream_token\x18\x02 \x01(\x0c\x12\x37\n\rwrite_results\x18\x03 \x03(\x0b\x32 .google.firestore.v1.WriteResult\x12/\n\x0b\x63ommit_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xf2\x01\n\rListenRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x31\n\nadd_target\x18\x02 \x01(\x0b\x32\x1b.google.firestore.v1.TargetH\x00\x12\x17\n\rremove_target\x18\x03 \x01(\x05H\x00\x12>\n\x06labels\x18\x04 \x03(\x0b\x32..google.firestore.v1.ListenRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x0f\n\rtarget_change\"\xd5\x02\n\x0eListenResponse\x12:\n\rtarget_change\x18\x02 \x01(\x0b\x32!.google.firestore.v1.TargetChangeH\x00\x12>\n\x0f\x64ocument_change\x18\x03 \x01(\x0b\x32#.google.firestore.v1.DocumentChangeH\x00\x12>\n\x0f\x64ocument_delete\x18\x04 \x01(\x0b\x32#.google.firestore.v1.DocumentDeleteH\x00\x12>\n\x0f\x64ocument_remove\x18\x06 \x01(\x0b\x32#.google.firestore.v1.DocumentRemoveH\x00\x12\x36\n\x06\x66ilter\x18\x05 \x01(\x0b\x32$.google.firestore.v1.ExistenceFilterH\x00\x42\x0f\n\rresponse_type\"\xd6\x03\n\x06Target\x12\x38\n\x05query\x18\x02 \x01(\x0b\x32\'.google.firestore.v1.Target.QueryTargetH\x00\x12@\n\tdocuments\x18\x03 \x01(\x0b\x32+.google.firestore.v1.Target.DocumentsTargetH\x00\x12\x16\n\x0cresume_token\x18\x04 \x01(\x0cH\x01\x12/\n\tread_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12\x11\n\ttarget_id\x18\x05 \x01(\x05\x12\x0c\n\x04once\x18\x06 \x01(\x08\x12\x33\n\x0e\x65xpected_count\x18\x0c \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x1a$\n\x0f\x44ocumentsTarget\x12\x11\n\tdocuments\x18\x02 \x03(\t\x1am\n\x0bQueryTarget\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12@\n\x10structured_query\x18\x02 \x01(\x0b\x32$.google.firestore.v1.StructuredQueryH\x00\x42\x0c\n\nquery_typeB\r\n\x0btarget_typeB\r\n\x0bresume_type\"\xaa\x02\n\x0cTargetChange\x12N\n\x12target_change_type\x18\x01 \x01(\x0e\x32\x32.google.firestore.v1.TargetChange.TargetChangeType\x12\x12\n\ntarget_ids\x18\x02 \x03(\x05\x12!\n\x05\x63\x61use\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12\x14\n\x0cresume_token\x18\x04 \x01(\x0c\x12-\n\tread_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"N\n\x10TargetChangeType\x12\r\n\tNO_CHANGE\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x12\x0b\n\x07\x43URRENT\x10\x03\x12\t\n\x05RESET\x10\x04\"\x9f\x01\n\x18ListCollectionIdsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12/\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x16\n\x14\x63onsistency_selector\"L\n\x19ListCollectionIdsResponse\x12\x16\n\x0e\x63ollection_ids\x18\x01 \x03(\t\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xc9\x01\n\x11\x42\x61tchWriteRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12*\n\x06writes\x18\x02 \x03(\x0b\x32\x1a.google.firestore.v1.Write\x12\x42\n\x06labels\x18\x03 \x03(\x0b\x32\x32.google.firestore.v1.BatchWriteRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"q\n\x12\x42\x61tchWriteResponse\x12\x37\n\rwrite_results\x18\x01 \x03(\x0b\x32 .google.firestore.v1.WriteResult\x12\"\n\x06status\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status2\xfb\x1b\n\tFirestore\x12\x8f\x01\n\x0bGetDocument\x12\'.google.firestore.v1.GetDocumentRequest\x1a\x1d.google.firestore.v1.Document\"8\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{name=projects/*/databases/*/documents/*/**}\x12\xf5\x01\n\rListDocuments\x12).google.firestore.v1.ListDocumentsRequest\x1a*.google.firestore.v1.ListDocumentsResponse\"\x8c\x01\x82\xd3\xe4\x93\x02\x85\x01\x12\x42/v1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}Z?\x12=/v1/{parent=projects/*/databases/*/documents}/{collection_id}\x12\xbf\x01\n\x0eUpdateDocument\x12*.google.firestore.v1.UpdateDocumentRequest\x1a\x1d.google.firestore.v1.Document\"b\xda\x41\x14\x64ocument,update_mask\x82\xd3\xe4\x93\x02\x45\x32\x39/v1/{document.name=projects/*/databases/*/documents/*/**}:\x08\x64ocument\x12\x95\x01\n\x0e\x44\x65leteDocument\x12*.google.firestore.v1.DeleteDocumentRequest\x1a\x16.google.protobuf.Empty\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32*0/v1/{name=projects/*/databases/*/documents/*/**}\x12\xb9\x01\n\x11\x42\x61tchGetDocuments\x12-.google.firestore.v1.BatchGetDocumentsRequest\x1a..google.firestore.v1.BatchGetDocumentsResponse\"C\x82\xd3\xe4\x93\x02=\"8/v1/{database=projects/*/databases/*}/documents:batchGet:\x01*0\x01\x12\xc7\x01\n\x10\x42\x65ginTransaction\x12,.google.firestore.v1.BeginTransactionRequest\x1a-.google.firestore.v1.BeginTransactionResponse\"V\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02\x45\"@/v1/{database=projects/*/databases/*}/documents:beginTransaction:\x01*\x12\xa6\x01\n\x06\x43ommit\x12\".google.firestore.v1.CommitRequest\x1a#.google.firestore.v1.CommitResponse\"S\xda\x41\x0f\x64\x61tabase,writes\x82\xd3\xe4\x93\x02;\"6/v1/{database=projects/*/databases/*}/documents:commit:\x01*\x12\xa4\x01\n\x08Rollback\x12$.google.firestore.v1.RollbackRequest\x1a\x16.google.protobuf.Empty\"Z\xda\x41\x14\x64\x61tabase,transaction\x82\xd3\xe4\x93\x02=\"8/v1/{database=projects/*/databases/*}/documents:rollback:\x01*\x12\xdf\x01\n\x08RunQuery\x12$.google.firestore.v1.RunQueryRequest\x1a%.google.firestore.v1.RunQueryResponse\"\x83\x01\x82\xd3\xe4\x93\x02}\"6/v1/{parent=projects/*/databases/*/documents}:runQuery:\x01*Z@\";/v1/{parent=projects/*/databases/*/documents/*/**}:runQuery:\x01*0\x01\x12\x9e\x02\n\x0f\x45xecutePipeline\x12+.google.firestore.v1.ExecutePipelineRequest\x1a,.google.firestore.v1.ExecutePipelineResponse\"\xad\x01\x82\xd3\xe4\x93\x02\x44\"?/v1/{database=projects/*/databases/*}/documents:executePipeline:\x01*\x8a\xd3\xe4\x93\x02]\x12&\n\x08\x64\x61tabase\x12\x1aprojects/{project_id=*}/**\x12\x33\n\x08\x64\x61tabase\x12\'projects/*/databases/{database_id=*}/**0\x01\x12\x97\x02\n\x13RunAggregationQuery\x12/.google.firestore.v1.RunAggregationQueryRequest\x1a\x30.google.firestore.v1.RunAggregationQueryResponse\"\x9a\x01\x82\xd3\xe4\x93\x02\x93\x01\"A/v1/{parent=projects/*/databases/*/documents}:runAggregationQuery:\x01*ZK\"F/v1/{parent=projects/*/databases/*/documents/*/**}:runAggregationQuery:\x01*0\x01\x12\xfc\x01\n\x0ePartitionQuery\x12*.google.firestore.v1.PartitionQueryRequest\x1a+.google.firestore.v1.PartitionQueryResponse\"\x90\x01\x82\xd3\xe4\x93\x02\x89\x01\"] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/routing.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/routing.rb new file mode 100644 index 000000000000..d777329024e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/routing.rb @@ -0,0 +1,459 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Specifies the routing information that should be sent along with the request + # in the form of routing header. + # **NOTE:** All service configuration rules follow the "last one wins" order. + # + # The examples below will apply to an RPC which has the following request type: + # + # Message Definition: + # + # message Request { + # // The name of the Table + # // Values can be of the following formats: + # // - `projects//tables/` + # // - `projects//instances//tables/
` + # // - `region//zones//tables/
` + # string table_name = 1; + # + # // This value specifies routing for replication. + # // It can be in the following formats: + # // - `profiles/` + # // - a legacy `profile_id` that can be any string + # string app_profile_id = 2; + # } + # + # Example message: + # + # { + # table_name: projects/proj_foo/instances/instance_bar/table/table_baz, + # app_profile_id: profiles/prof_qux + # } + # + # The routing header consists of one or multiple key-value pairs. Every key + # and value must be percent-encoded, and joined together in the format of + # `key1=value1&key2=value2`. + # The examples below skip the percent-encoding for readability. + # + # Example 1 + # + # Extracting a field from the request to put into the routing header + # unchanged, with the key equal to the field name. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `app_profile_id`. + # routing_parameters { + # field: "app_profile_id" + # } + # }; + # + # result: + # + # x-goog-request-params: app_profile_id=profiles/prof_qux + # + # Example 2 + # + # Extracting a field from the request to put into the routing header + # unchanged, with the key different from the field name. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `app_profile_id`, but name it `routing_id` in the header. + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # }; + # + # result: + # + # x-goog-request-params: routing_id=profiles/prof_qux + # + # Example 3 + # + # Extracting a field from the request to put into the routing + # header, while matching a path template syntax on the field's value. + # + # NB: it is more useful to send nothing than to send garbage for the purpose + # of dynamic routing, since garbage pollutes cache. Thus the matching. + # + # Sub-example 3a + # + # The field matches the template. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `table_name`, if it's well-formed (with project-based + # // syntax). + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=projects/*/instances/*/**}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # table_name=projects/proj_foo/instances/instance_bar/table/table_baz + # + # Sub-example 3b + # + # The field does not match the template. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `table_name`, if it's well-formed (with region-based + # // syntax). + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=regions/*/zones/*/**}" + # } + # }; + # + # result: + # + # + # + # Sub-example 3c + # + # Multiple alternative conflictingly named path templates are + # specified. The one that matches is used to construct the header. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `table_name`, if it's well-formed, whether + # // using the region- or projects-based syntax. + # + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=regions/*/zones/*/**}" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=projects/*/instances/*/**}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # table_name=projects/proj_foo/instances/instance_bar/table/table_baz + # + # Example 4 + # + # Extracting a single routing header key-value pair by matching a + # template syntax on (a part of) a single request field. + # + # annotation: + # + # option (google.api.routing) = { + # // Take just the project id from the `table_name` field. + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # }; + # + # result: + # + # x-goog-request-params: routing_id=projects/proj_foo + # + # Example 5 + # + # Extracting a single routing header key-value pair by matching + # several conflictingly named path templates on (parts of) a single request + # field. The last template to match "wins" the conflict. + # + # annotation: + # + # option (google.api.routing) = { + # // If the `table_name` does not have instances information, + # // take just the project id for routing. + # // Otherwise take project + instance. + # + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*/instances/*}/**" + # } + # }; + # + # result: + # + # x-goog-request-params: + # routing_id=projects/proj_foo/instances/instance_bar + # + # Example 6 + # + # Extracting multiple routing header key-value pairs by matching + # several non-conflicting path templates on (parts of) a single request field. + # + # Sub-example 6a + # + # Make the templates strict, so that if the `table_name` does not + # have an instance information, nothing is sent. + # + # annotation: + # + # option (google.api.routing) = { + # // The routing code needs two keys instead of one composite + # // but works only for the tables with the "project-instance" name + # // syntax. + # + # routing_parameters { + # field: "table_name" + # path_template: "{project_id=projects/*}/instances/*/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "projects/*/{instance_id=instances/*}/**" + # } + # }; + # + # result: + # + # x-goog-request-params: + # project_id=projects/proj_foo&instance_id=instances/instance_bar + # + # Sub-example 6b + # + # Make the templates loose, so that if the `table_name` does not + # have an instance information, just the project id part is sent. + # + # annotation: + # + # option (google.api.routing) = { + # // The routing code wants two keys instead of one composite + # // but will work with just the `project_id` for tables without + # // an instance in the `table_name`. + # + # routing_parameters { + # field: "table_name" + # path_template: "{project_id=projects/*}/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "projects/*/{instance_id=instances/*}/**" + # } + # }; + # + # result (is the same as 6a for our example message because it has the instance + # information): + # + # x-goog-request-params: + # project_id=projects/proj_foo&instance_id=instances/instance_bar + # + # Example 7 + # + # Extracting multiple routing header key-value pairs by matching + # several path templates on multiple request fields. + # + # NB: note that here there is no way to specify sending nothing if one of the + # fields does not match its template. E.g. if the `table_name` is in the wrong + # format, the `project_id` will not be sent, but the `routing_id` will be. + # The backend routing code has to be aware of that and be prepared to not + # receive a full complement of keys if it expects multiple. + # + # annotation: + # + # option (google.api.routing) = { + # // The routing needs both `project_id` and `routing_id` + # // (from the `app_profile_id` field) for routing. + # + # routing_parameters { + # field: "table_name" + # path_template: "{project_id=projects/*}/**" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # project_id=projects/proj_foo&routing_id=profiles/prof_qux + # + # Example 8 + # + # Extracting a single routing header key-value pair by matching + # several conflictingly named path templates on several request fields. The + # last template to match "wins" the conflict. + # + # annotation: + # + # option (google.api.routing) = { + # // The `routing_id` can be a project id or a region id depending on + # // the table name format, but only if the `app_profile_id` is not set. + # // If `app_profile_id` is set it should be used instead. + # + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=regions/*}/**" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # }; + # + # result: + # + # x-goog-request-params: routing_id=profiles/prof_qux + # + # Example 9 + # + # Bringing it all together. + # + # annotation: + # + # option (google.api.routing) = { + # // For routing both `table_location` and a `routing_id` are needed. + # // + # // table_location can be either an instance id or a region+zone id. + # // + # // For `routing_id`, take the value of `app_profile_id` + # // - If it's in the format `profiles/`, send + # // just the `` part. + # // - If it's any other literal, send it as is. + # // If the `app_profile_id` is empty, and the `table_name` starts with + # // the project_id, send that instead. + # + # routing_parameters { + # field: "table_name" + # path_template: "projects/*/{table_location=instances/*}/tables/*" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{table_location=regions/*/zones/*}/tables/*" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "profiles/{routing_id=*}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # table_location=instances/instance_bar&routing_id=prof_qux + # @!attribute [rw] routing_parameters + # @return [::Array<::Google::Api::RoutingParameter>] + # A collection of Routing Parameter specifications. + # **NOTE:** If multiple Routing Parameters describe the same key + # (via the `path_template` field or via the `field` field when + # `path_template` is not provided), "last one wins" rule + # determines which Parameter gets used. + # See the examples for more details. + class RoutingRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A projection from an input message to the GRPC or REST header. + # @!attribute [rw] field + # @return [::String] + # A request field to extract the header key-value pair from. + # @!attribute [rw] path_template + # @return [::String] + # A pattern matching the key-value field. Optional. + # If not specified, the whole field specified in the `field` field will be + # taken as value, and its name used as key. If specified, it MUST contain + # exactly one named segment (along with any number of unnamed segments) The + # pattern will be matched over the field specified in the `field` field, then + # if the match is successful: + # - the name of the single named segment will be used as a header name, + # - the match value of the segment will be used as a header value; + # if the match is NOT successful, nothing will be sent. + # + # Example: + # + # -- This is a field in the request message + # | that the header value will be extracted from. + # | + # | -- This is the key name in the + # | | routing header. + # V | + # field: "table_name" v + # path_template: "projects/*/{table_location=instances/*}/tables/*" + # ^ ^ + # | | + # In the {} brackets is the pattern that -- | + # specifies what to extract from the | + # field as a value to be sent. | + # | + # The string in the field must match the whole pattern -- + # before brackets, inside brackets, after brackets. + # + # When looking at this specific example, we can see that: + # - A key-value pair with the key `table_location` + # and the value matching `instances/*` should be added + # to the x-goog-request-params routing header. + # - The value is extracted from the request message's `table_name` field + # if it matches the full pattern specified: + # `projects/*/instances/*/tables/*`. + # + # **NB:** If the `path_template` field is not provided, the key name is + # equal to the field name, and the whole field should be sent as a value. + # This makes the pattern for the field and the value functionally equivalent + # to `**`, and the configuration + # + # { + # field: "table_name" + # } + # + # is a functionally equivalent shorthand to: + # + # { + # field: "table_name" + # path_template: "{table_name=**}" + # } + # + # See Example 1 for more details. + class RoutingParameter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/aggregation_result.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/aggregation_result.rb new file mode 100644 index 000000000000..cbb83ff369da --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/aggregation_result.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Firestore + module V1 + # The result of a single bucket from a Firestore aggregation query. + # + # The keys of `aggregate_fields` are the same for all results in an aggregation + # query, unlike document queries which can have different fields present for + # each result. + # @!attribute [rw] aggregate_fields + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}] + # The result of the aggregation functions, ex: `COUNT(*) AS total_docs`. + # + # The key is the + # {::Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation#alias alias} + # assigned to the aggregation function on input and the size of this map + # equals the number of aggregation functions in the query. + class AggregationResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Firestore::V1::Value] + class AggregateFieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/bloom_filter.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/bloom_filter.rb new file mode 100644 index 000000000000..dd4118168b2c --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/bloom_filter.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Firestore + module V1 + # A sequence of bits, encoded in a byte array. + # + # Each byte in the `bitmap` byte array stores 8 bits of the sequence. The only + # exception is the last byte, which may store 8 _or fewer_ bits. The `padding` + # defines the number of bits of the last byte to be ignored as "padding". The + # values of these "padding" bits are unspecified and must be ignored. + # + # To retrieve the first bit, bit 0, calculate: `(bitmap[0] & 0x01) != 0`. + # To retrieve the second bit, bit 1, calculate: `(bitmap[0] & 0x02) != 0`. + # To retrieve the third bit, bit 2, calculate: `(bitmap[0] & 0x04) != 0`. + # To retrieve the fourth bit, bit 3, calculate: `(bitmap[0] & 0x08) != 0`. + # To retrieve bit n, calculate: `(bitmap[n / 8] & (0x01 << (n % 8))) != 0`. + # + # The "size" of a `BitSequence` (the number of bits it contains) is calculated + # by this formula: `(bitmap.length * 8) - padding`. + # @!attribute [rw] bitmap + # @return [::String] + # The bytes that encode the bit sequence. + # May have a length of zero. + # @!attribute [rw] padding + # @return [::Integer] + # The number of bits of the last byte in `bitmap` to ignore as "padding". + # If the length of `bitmap` is zero, then this value must be `0`. + # Otherwise, this value must be between 0 and 7, inclusive. + class BitSequence + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A bloom filter (https://en.wikipedia.org/wiki/Bloom_filter). + # + # The bloom filter hashes the entries with MD5 and treats the resulting 128-bit + # hash as 2 distinct 64-bit hash values, interpreted as unsigned integers + # using 2's complement encoding. + # + # These two hash values, named `h1` and `h2`, are then used to compute the + # `hash_count` hash values using the formula, starting at `i=0`: + # + # h(i) = h1 + (i * h2) + # + # These resulting values are then taken modulo the number of bits in the bloom + # filter to get the bits of the bloom filter to test for the given entry. + # @!attribute [rw] bits + # @return [::Google::Cloud::Firestore::V1::BitSequence] + # The bloom filter data. + # @!attribute [rw] hash_count + # @return [::Integer] + # The number of hashes used by the algorithm. + class BloomFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/common.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/common.rb new file mode 100644 index 000000000000..aa8ef8a9180c --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/common.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Firestore + module V1 + # A set of field paths on a document. + # Used to restrict a get or update operation on a document to a subset of its + # fields. + # This is different from standard field masks, as this is always scoped to a + # {::Google::Cloud::Firestore::V1::Document Document}, and takes in account the dynamic + # nature of {::Google::Cloud::Firestore::V1::Value Value}. + # @!attribute [rw] field_paths + # @return [::Array<::String>] + # The list of field paths in the mask. See + # {::Google::Cloud::Firestore::V1::Document#fields Document.fields} for a field path + # syntax reference. + class DocumentMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A precondition on a document, used for conditional operations. + # @!attribute [rw] exists + # @return [::Boolean] + # When set to `true`, the target document must exist. + # When set to `false`, the target document must not exist. + # + # Note: The following fields are mutually exclusive: `exists`, `update_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # When set, the target document must exist and have been last updated at + # that time. Timestamp must be microsecond aligned. + # + # Note: The following fields are mutually exclusive: `update_time`, `exists`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Precondition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options for creating a new transaction. + # @!attribute [rw] read_only + # @return [::Google::Cloud::Firestore::V1::TransactionOptions::ReadOnly] + # The transaction can only be used for read operations. + # + # Note: The following fields are mutually exclusive: `read_only`, `read_write`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] read_write + # @return [::Google::Cloud::Firestore::V1::TransactionOptions::ReadWrite] + # The transaction can be used for both read and write operations. + # + # Note: The following fields are mutually exclusive: `read_write`, `read_only`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class TransactionOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Options for a transaction that can be used to read and write documents. + # + # Firestore does not allow 3rd party auth requests to create read-write. + # transactions. + # @!attribute [rw] retry_transaction + # @return [::String] + # An optional transaction to retry. + class ReadWrite + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options for a transaction that can only be used to read documents. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Reads documents at the given time. + # + # This must be a microsecond precision timestamp within the past one + # hour, or if Point-in-Time Recovery is enabled, can additionally be a + # whole minute timestamp within the past 7 days. + class ReadOnly + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/document.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/document.rb new file mode 100644 index 000000000000..f20a2a991b11 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/document.rb @@ -0,0 +1,326 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Firestore + module V1 + # A Firestore document. + # + # Must not exceed 1 MiB - 4 bytes. + # @!attribute [rw] name + # @return [::String] + # The resource name of the document, for example + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # @!attribute [rw] fields + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}] + # The document's fields. + # + # The map keys represent field names. + # + # Field names matching the regular expression `__.*__` are reserved. Reserved + # field names are forbidden except in certain documented contexts. The field + # names, represented as UTF-8, must not exceed 1,500 bytes and cannot be + # empty. + # + # Field paths may be used in other contexts to refer to structured fields + # defined here. For `map_value`, the field path is represented by a + # dot-delimited (`.`) string of segments. Each segment is either a simple + # field name (defined below) or a quoted field name. For example, the + # structured field `"foo" : { map_value: { "x&y" : { string_value: "hello" + # }}}` would be represented by the field path `` foo.`x&y` ``. + # + # A simple field name contains only characters `a` to `z`, `A` to `Z`, + # `0` to `9`, or `_`, and must not start with `0` to `9`. For example, + # `foo_bar_17`. + # + # A quoted field name starts and ends with `` ` `` and + # may contain any character. Some characters, including `` ` ``, must be + # escaped using a `\`. For example, `` `x&y` `` represents `x&y` and + # `` `bak\`tik` `` represents `` bak`tik ``. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the document was created. + # + # This value increases monotonically when a document is deleted then + # recreated. It can also be compared to values from other documents and + # the `read_time` of a query. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the document was last changed. + # + # This value is initially set to the `create_time` then increases + # monotonically with each change to the document. It can also be + # compared to values from other documents and the `read_time` of a query. + class Document + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Firestore::V1::Value] + class FieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A message that can hold any of the supported value types. + # @!attribute [rw] null_value + # @return [::Google::Protobuf::NullValue] + # A null value. + # + # Note: The following fields are mutually exclusive: `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] boolean_value + # @return [::Boolean] + # A boolean value. + # + # Note: The following fields are mutually exclusive: `boolean_value`, `null_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] integer_value + # @return [::Integer] + # An integer value. + # + # Note: The following fields are mutually exclusive: `integer_value`, `null_value`, `boolean_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] double_value + # @return [::Float] + # A double value. + # + # Note: The following fields are mutually exclusive: `double_value`, `null_value`, `boolean_value`, `integer_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] timestamp_value + # @return [::Google::Protobuf::Timestamp] + # A timestamp value. + # + # Precise only to microseconds. When stored, any additional precision is + # rounded down. + # + # Note: The following fields are mutually exclusive: `timestamp_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] string_value + # @return [::String] + # A string value. + # + # The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. + # Only the first 1,500 bytes of the UTF-8 representation are considered by + # queries. + # + # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bytes_value + # @return [::String] + # A bytes value. + # + # Must not exceed 1 MiB - 89 bytes. + # Only the first 1,500 bytes are considered by queries. + # + # Note: The following fields are mutually exclusive: `bytes_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] reference_value + # @return [::String] + # A reference to a document. For example: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # + # Note: The following fields are mutually exclusive: `reference_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] geo_point_value + # @return [::Google::Type::LatLng] + # A geo point value representing a point on the surface of Earth. + # + # Note: The following fields are mutually exclusive: `geo_point_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] array_value + # @return [::Google::Cloud::Firestore::V1::ArrayValue] + # An array value. + # + # Cannot directly contain another array value, though can contain a + # map which contains another array. + # + # Note: The following fields are mutually exclusive: `array_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] map_value + # @return [::Google::Cloud::Firestore::V1::MapValue] + # A map value. + # + # Note: The following fields are mutually exclusive: `map_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] field_reference_value + # @return [::String] + # Value which references a field. + # + # This is considered relative (vs absolute) since it only refers to a field + # and not a field within a particular document. + # + # **Requires:** + # + # * Must follow [field reference][FieldReference.field_path] limitations. + # + # * Not allowed to be used when writing documents. + # + # Note: The following fields are mutually exclusive: `field_reference_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] variable_reference_value + # @return [::String] + # Pointer to a variable defined elsewhere in a pipeline. + # + # Unlike `field_reference_value` which references a field within a + # document, this refers to a variable, defined in a separate namespace than + # the fields of a document. + # + # Note: The following fields are mutually exclusive: `variable_reference_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] function_value + # @return [::Google::Cloud::Firestore::V1::Function] + # A value that represents an unevaluated expression. + # + # **Requires:** + # + # * Not allowed to be used when writing documents. + # + # Note: The following fields are mutually exclusive: `function_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] pipeline_value + # @return [::Google::Cloud::Firestore::V1::Pipeline] + # A value that represents an unevaluated pipeline. + # + # **Requires:** + # + # * Not allowed to be used when writing documents. + # + # Note: The following fields are mutually exclusive: `pipeline_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An array value. + # @!attribute [rw] values + # @return [::Array<::Google::Cloud::Firestore::V1::Value>] + # Values in the array. + class ArrayValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A map value. + # @!attribute [rw] fields + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}] + # The map's fields. + # + # The map keys represent field names. Field names matching the regular + # expression `__.*__` are reserved. Reserved field names are forbidden except + # in certain documented contexts. The map keys, represented as UTF-8, must + # not exceed 1,500 bytes and cannot be empty. + class MapValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Firestore::V1::Value] + class FieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents an unevaluated scalar expression. + # + # For example, the expression `like(user_name, "%alice%")` is represented as: + # + # ``` + # name: "like" + # args { field_reference: "user_name" } + # args { string_value: "%alice%" } + # ``` + # @!attribute [rw] name + # @return [::String] + # Required. The name of the function to evaluate. + # + # **Requires:** + # + # * must be in snake case (lower case with underscore separator). + # @!attribute [rw] args + # @return [::Array<::Google::Cloud::Firestore::V1::Value>] + # Optional. Ordered list of arguments the given function expects. + # @!attribute [rw] options + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}] + # Optional. Optional named arguments that certain functions may support. + class Function + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Firestore::V1::Value] + class OptionsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A Firestore query represented as an ordered list of operations / stages. + # @!attribute [rw] stages + # @return [::Array<::Google::Cloud::Firestore::V1::Pipeline::Stage>] + # Required. Ordered list of stages to evaluate. + class Pipeline + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A single operation within a pipeline. + # + # A stage is made up of a unique name, and a list of arguments. The exact + # number of arguments & types is dependent on the stage type. + # + # To give an example, the stage `filter(state = "MD")` would be encoded as: + # + # ``` + # name: "filter" + # args { + # function_value { + # name: "eq" + # args { field_reference_value: "state" } + # args { string_value: "MD" } + # } + # } + # ``` + # + # See public documentation for the full list. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the stage to evaluate. + # + # **Requires:** + # + # * must be in snake case (lower case with underscore separator). + # @!attribute [rw] args + # @return [::Array<::Google::Cloud::Firestore::V1::Value>] + # Optional. Ordered list of arguments the given stage expects. + # @!attribute [rw] options + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}] + # Optional. Optional named arguments that certain functions may support. + class Stage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Firestore::V1::Value] + class OptionsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/explain_stats.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/explain_stats.rb new file mode 100644 index 000000000000..1ef7dad15f8c --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/explain_stats.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Firestore + module V1 + # Pipeline explain stats. + # + # Depending on the explain options in the original request, this can contain + # the optimized plan and / or execution stats. + # @!attribute [rw] data + # @return [::Google::Protobuf::Any] + # The format depends on the `output_format` options in the request. + # + # Currently there are two supported options: `TEXT` and `JSON`. + # Both supply a `google.protobuf.StringValue`. + class ExplainStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/firestore.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/firestore.rb new file mode 100644 index 000000000000..a070482dd304 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/firestore.rb @@ -0,0 +1,1110 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Firestore + module V1 + # The request for + # {::Google::Cloud::Firestore::V1::Firestore::Client#get_document Firestore.GetDocument}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Document to get. In the format: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # @!attribute [rw] mask + # @return [::Google::Cloud::Firestore::V1::DocumentMask] + # The fields to return. If not set, returns all fields. + # + # If the document has a field that is not present in this mask, that field + # will not be returned in the response. + # @!attribute [rw] transaction + # @return [::String] + # Reads the document in a transaction. + # + # Note: The following fields are mutually exclusive: `transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Reads the version of the document at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following fields are mutually exclusive: `read_time`, `transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class GetDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::V1::Firestore::Client#list_documents Firestore.ListDocuments}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name. In the format: + # `projects/{project_id}/databases/{database_id}/documents` or + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # + # For example: + # `projects/my-project/databases/my-database/documents` or + # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + # @!attribute [rw] collection_id + # @return [::String] + # Optional. The collection ID, relative to `parent`, to list. + # + # For example: `chatrooms` or `messages`. + # + # This is optional, and when not provided, Firestore will list documents + # from all collections under the provided `parent`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of documents to return in a single response. + # + # Firestore may return fewer than this value. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListDocuments` response. + # + # Provide this to retrieve the subsequent page. When paginating, all other + # parameters (with the exception of `page_size`) must match the values set + # in the request that generated the page token. + # @!attribute [rw] order_by + # @return [::String] + # Optional. The optional ordering of the documents to return. + # + # For example: `priority desc, __name__ desc`. + # + # This mirrors the {::Google::Cloud::Firestore::V1::StructuredQuery#order_by `ORDER BY`} + # used in Firestore queries but in a string representation. When absent, + # documents are ordered based on `__name__ ASC`. + # @!attribute [rw] mask + # @return [::Google::Cloud::Firestore::V1::DocumentMask] + # Optional. The fields to return. If not set, returns all fields. + # + # If a document has a field that is not present in this mask, that field + # will not be returned in the response. + # @!attribute [rw] transaction + # @return [::String] + # Perform the read as part of an already active transaction. + # + # Note: The following fields are mutually exclusive: `transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Perform the read at the provided time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following fields are mutually exclusive: `read_time`, `transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] show_missing + # @return [::Boolean] + # If the list should show missing documents. + # + # A document is missing if it does not exist, but there are sub-documents + # nested underneath it. When true, such missing documents will be returned + # with a key but will not have fields, + # {::Google::Cloud::Firestore::V1::Document#create_time `create_time`}, or + # {::Google::Cloud::Firestore::V1::Document#update_time `update_time`} set. + # + # Requests with `show_missing` may not specify `where` or `order_by`. + class ListDocumentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Firestore::V1::Firestore::Client#list_documents Firestore.ListDocuments}. + # @!attribute [rw] documents + # @return [::Array<::Google::Cloud::Firestore::V1::Document>] + # The Documents found. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of documents. + # + # If this field is omitted, there are no subsequent pages. + class ListDocumentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::V1::Firestore::Client#create_document Firestore.CreateDocument}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource. For example: + # `projects/{project_id}/databases/{database_id}/documents` or + # `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + # @!attribute [rw] collection_id + # @return [::String] + # Required. The collection ID, relative to `parent`, to list. For example: + # `chatrooms`. + # @!attribute [rw] document_id + # @return [::String] + # The client-assigned document ID to use for this document. + # + # Optional. If not specified, an ID will be assigned by the service. + # @!attribute [rw] document + # @return [::Google::Cloud::Firestore::V1::Document] + # Required. The document to create. `name` must not be set. + # @!attribute [rw] mask + # @return [::Google::Cloud::Firestore::V1::DocumentMask] + # The fields to return. If not set, returns all fields. + # + # If the document has a field that is not present in this mask, that field + # will not be returned in the response. + class CreateDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::V1::Firestore::Client#update_document Firestore.UpdateDocument}. + # @!attribute [rw] document + # @return [::Google::Cloud::Firestore::V1::Document] + # Required. The updated document. + # Creates the document if it does not already exist. + # @!attribute [rw] update_mask + # @return [::Google::Cloud::Firestore::V1::DocumentMask] + # The fields to update. + # None of the field paths in the mask may contain a reserved name. + # + # If the document exists on the server and has fields not referenced in the + # mask, they are left unchanged. + # Fields referenced in the mask, but not present in the input document, are + # deleted from the document on the server. + # @!attribute [rw] mask + # @return [::Google::Cloud::Firestore::V1::DocumentMask] + # The fields to return. If not set, returns all fields. + # + # If the document has a field that is not present in this mask, that field + # will not be returned in the response. + # @!attribute [rw] current_document + # @return [::Google::Cloud::Firestore::V1::Precondition] + # An optional precondition on the document. + # The request will fail if this is set and not met by the target document. + class UpdateDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::V1::Firestore::Client#delete_document Firestore.DeleteDocument}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Document to delete. In the format: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # @!attribute [rw] current_document + # @return [::Google::Cloud::Firestore::V1::Precondition] + # An optional precondition on the document. + # The request will fail if this is set and not met by the target document. + class DeleteDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::V1::Firestore::Client#batch_get_documents Firestore.BatchGetDocuments}. + # @!attribute [rw] database + # @return [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @!attribute [rw] documents + # @return [::Array<::String>] + # The names of the documents to retrieve. In the format: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # The request will fail if any of the document is not a child resource of the + # given `database`. Duplicate names will be elided. + # @!attribute [rw] mask + # @return [::Google::Cloud::Firestore::V1::DocumentMask] + # The fields to return. If not set, returns all fields. + # + # If a document has a field that is not present in this mask, that field will + # not be returned in the response. + # @!attribute [rw] transaction + # @return [::String] + # Reads documents in a transaction. + # + # Note: The following fields are mutually exclusive: `transaction`, `new_transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] new_transaction + # @return [::Google::Cloud::Firestore::V1::TransactionOptions] + # Starts a new transaction and reads the documents. + # Defaults to a read-only transaction. + # The new transaction ID will be returned as the first response in the + # stream. + # + # Note: The following fields are mutually exclusive: `new_transaction`, `transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Reads documents as they were at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following fields are mutually exclusive: `read_time`, `transaction`, `new_transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class BatchGetDocumentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The streamed response for + # {::Google::Cloud::Firestore::V1::Firestore::Client#batch_get_documents Firestore.BatchGetDocuments}. + # @!attribute [rw] found + # @return [::Google::Cloud::Firestore::V1::Document] + # A document that was requested. + # + # Note: The following fields are mutually exclusive: `found`, `missing`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] missing + # @return [::String] + # A document name that was requested but does not exist. In the format: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # + # Note: The following fields are mutually exclusive: `missing`, `found`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] transaction + # @return [::String] + # The transaction that was started as part of this request. + # Will only be set in the first response, and only if + # {::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest#new_transaction BatchGetDocumentsRequest.new_transaction} + # was set in the request. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the document was read. + # This may be monotically increasing, in this case the previous documents in + # the result stream are guaranteed not to have changed between their + # read_time and this one. + class BatchGetDocumentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::V1::Firestore::Client#begin_transaction Firestore.BeginTransaction}. + # @!attribute [rw] database + # @return [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @!attribute [rw] options + # @return [::Google::Cloud::Firestore::V1::TransactionOptions] + # The options for the transaction. + # Defaults to a read-write transaction. + class BeginTransactionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Firestore::V1::Firestore::Client#begin_transaction Firestore.BeginTransaction}. + # @!attribute [rw] transaction + # @return [::String] + # The transaction that was started. + class BeginTransactionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Firestore::V1::Firestore::Client#commit Firestore.Commit}. + # @!attribute [rw] database + # @return [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @!attribute [rw] writes + # @return [::Array<::Google::Cloud::Firestore::V1::Write>] + # The writes to apply. + # + # Always executed atomically and in order. + # @!attribute [rw] transaction + # @return [::String] + # If set, applies all writes in this transaction, and commits it. + class CommitRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for {::Google::Cloud::Firestore::V1::Firestore::Client#commit Firestore.Commit}. + # @!attribute [rw] write_results + # @return [::Array<::Google::Cloud::Firestore::V1::WriteResult>] + # The result of applying the writes. + # + # This i-th write result corresponds to the i-th write in the + # request. + # @!attribute [rw] commit_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the commit occurred. Any read with an equal or greater + # `read_time` is guaranteed to see the effects of the commit. + class CommitResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Firestore::V1::Firestore::Client#rollback Firestore.Rollback}. + # @!attribute [rw] database + # @return [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @!attribute [rw] transaction + # @return [::String] + # Required. The transaction to roll back. + class RollbackRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Firestore::V1::Firestore::Client#run_query Firestore.RunQuery}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name. In the format: + # `projects/{project_id}/databases/{database_id}/documents` or + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # For example: + # `projects/my-project/databases/my-database/documents` or + # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + # @!attribute [rw] structured_query + # @return [::Google::Cloud::Firestore::V1::StructuredQuery] + # A structured query. + # @!attribute [rw] transaction + # @return [::String] + # Run the query within an already active transaction. + # + # The value here is the opaque transaction ID to execute the query in. + # + # Note: The following fields are mutually exclusive: `transaction`, `new_transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] new_transaction + # @return [::Google::Cloud::Firestore::V1::TransactionOptions] + # Starts a new transaction and reads the documents. + # Defaults to a read-only transaction. + # The new transaction ID will be returned as the first response in the + # stream. + # + # Note: The following fields are mutually exclusive: `new_transaction`, `transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Reads documents as they were at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following fields are mutually exclusive: `read_time`, `transaction`, `new_transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] explain_options + # @return [::Google::Cloud::Firestore::V1::ExplainOptions] + # Optional. Explain options for the query. If set, additional query + # statistics will be returned. If not, only query results will be returned. + class RunQueryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Firestore::V1::Firestore::Client#run_query Firestore.RunQuery}. + # @!attribute [rw] transaction + # @return [::String] + # The transaction that was started as part of this request. + # Can only be set in the first response, and only if + # {::Google::Cloud::Firestore::V1::RunQueryRequest#new_transaction RunQueryRequest.new_transaction} + # was set in the request. If set, no other fields will be set in this + # response. + # @!attribute [rw] document + # @return [::Google::Cloud::Firestore::V1::Document] + # A query result, not set when reporting partial progress. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the document was read. This may be monotonically + # increasing; in this case, the previous documents in the result stream are + # guaranteed not to have changed between their `read_time` and this one. + # + # If the query returns no results, a response with `read_time` and no + # `document` will be sent, and this represents the time at which the query + # was run. + # @!attribute [rw] skipped_results + # @return [::Integer] + # The number of results that have been skipped due to an offset between + # the last response and the current response. + # @!attribute [rw] done + # @return [::Boolean] + # If present, Firestore has completely finished the request and no more + # documents will be returned. + # @!attribute [rw] explain_metrics + # @return [::Google::Cloud::Firestore::V1::ExplainMetrics] + # Query explain metrics. This is only present when the + # {::Google::Cloud::Firestore::V1::RunQueryRequest#explain_options RunQueryRequest.explain_options} + # is provided, and it is sent only once with the last response in the stream. + class RunQueryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::V1::Firestore::Client#execute_pipeline Firestore.ExecutePipeline}. + # @!attribute [rw] database + # @return [::String] + # Required. Database identifier, in the form + # `projects/{project}/databases/{database}`. + # @!attribute [rw] structured_pipeline + # @return [::Google::Cloud::Firestore::V1::StructuredPipeline] + # A pipelined operation. + # @!attribute [rw] transaction + # @return [::String] + # Run the query within an already active transaction. + # + # The value here is the opaque transaction ID to execute the query in. + # + # Note: The following fields are mutually exclusive: `transaction`, `new_transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] new_transaction + # @return [::Google::Cloud::Firestore::V1::TransactionOptions] + # Execute the pipeline in a new transaction. + # + # The identifier of the newly created transaction will be returned in the + # first response on the stream. This defaults to a read-only transaction. + # + # Note: The following fields are mutually exclusive: `new_transaction`, `transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Execute the pipeline in a snapshot transaction at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following fields are mutually exclusive: `read_time`, `transaction`, `new_transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ExecutePipelineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for [Firestore.Execute][]. + # @!attribute [rw] transaction + # @return [::String] + # Newly created transaction identifier. + # + # This field is only specified as part of the first response from the server, + # alongside the `results` field when the original request specified + # [ExecuteRequest.new_transaction][]. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Firestore::V1::Document>] + # An ordered batch of results returned executing a pipeline. + # + # The batch size is variable, and can even be zero for when only a partial + # progress message is returned. + # + # The fields present in the returned documents are only those that were + # explicitly requested in the pipeline, this includes those like + # {::Google::Cloud::Firestore::V1::Document#name `__name__`} and + # {::Google::Cloud::Firestore::V1::Document#update_time `__update_time__`}. This is + # explicitly a divergence from `Firestore.RunQuery` / `Firestore.GetDocument` + # RPCs which always return such fields even when they are not specified in + # the {::Google::Cloud::Firestore::V1::DocumentMask `mask`}. + # @!attribute [rw] execution_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the results are valid. + # + # This is a (not strictly) monotonically increasing value across multiple + # responses in the same stream. The API guarantees that all previously + # returned results are still valid at the latest `execution_time`. This + # allows the API consumer to treat the query if it ran at the latest + # `execution_time` returned. + # + # If the query returns no results, a response with `execution_time` and no + # `results` will be sent, and this represents the time at which the operation + # was run. + # @!attribute [rw] explain_stats + # @return [::Google::Cloud::Firestore::V1::ExplainStats] + # Query explain stats. + # + # This is present on the **last** response if the request configured explain + # to run in 'analyze' or 'explain' mode in the pipeline options. If the query + # does not return any results, a response with `explain_stats` and no + # `results` will still be sent. + class ExecutePipelineResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::V1::Firestore::Client#run_aggregation_query Firestore.RunAggregationQuery}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name. In the format: + # `projects/{project_id}/databases/{database_id}/documents` or + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # For example: + # `projects/my-project/databases/my-database/documents` or + # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + # @!attribute [rw] structured_aggregation_query + # @return [::Google::Cloud::Firestore::V1::StructuredAggregationQuery] + # An aggregation query. + # @!attribute [rw] transaction + # @return [::String] + # Run the aggregation within an already active transaction. + # + # The value here is the opaque transaction ID to execute the query in. + # + # Note: The following fields are mutually exclusive: `transaction`, `new_transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] new_transaction + # @return [::Google::Cloud::Firestore::V1::TransactionOptions] + # Starts a new transaction as part of the query, defaulting to read-only. + # + # The new transaction ID will be returned as the first response in the + # stream. + # + # Note: The following fields are mutually exclusive: `new_transaction`, `transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Executes the query at the given timestamp. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + # + # Note: The following fields are mutually exclusive: `read_time`, `transaction`, `new_transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] explain_options + # @return [::Google::Cloud::Firestore::V1::ExplainOptions] + # Optional. Explain options for the query. If set, additional query + # statistics will be returned. If not, only query results will be returned. + class RunAggregationQueryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Firestore::V1::Firestore::Client#run_aggregation_query Firestore.RunAggregationQuery}. + # @!attribute [rw] result + # @return [::Google::Cloud::Firestore::V1::AggregationResult] + # A single aggregation result. + # + # Not present when reporting partial progress. + # @!attribute [rw] transaction + # @return [::String] + # The transaction that was started as part of this request. + # + # Only present on the first response when the request requested to start + # a new transaction. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the aggregate result was computed. This is always + # monotonically increasing; in this case, the previous AggregationResult in + # the result stream are guaranteed not to have changed between their + # `read_time` and this one. + # + # If the query returns no results, a response with `read_time` and no + # `result` will be sent, and this represents the time at which the query + # was run. + # @!attribute [rw] explain_metrics + # @return [::Google::Cloud::Firestore::V1::ExplainMetrics] + # Query explain metrics. This is only present when the + # {::Google::Cloud::Firestore::V1::RunAggregationQueryRequest#explain_options RunAggregationQueryRequest.explain_options} + # is provided, and it is sent only once with the last response in the stream. + class RunAggregationQueryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::V1::Firestore::Client#partition_query Firestore.PartitionQuery}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name. In the format: + # `projects/{project_id}/databases/{database_id}/documents`. + # Document resource names are not supported; only database resource names + # can be specified. + # @!attribute [rw] structured_query + # @return [::Google::Cloud::Firestore::V1::StructuredQuery] + # A structured query. + # Query must specify collection with all descendants and be ordered by name + # ascending. Other filters, order bys, limits, offsets, and start/end + # cursors are not supported. + # @!attribute [rw] partition_count + # @return [::Integer] + # The desired maximum number of partition points. + # The partitions may be returned across multiple pages of results. + # The number must be positive. The actual number of partitions + # returned may be fewer. + # + # For example, this may be set to one fewer than the number of parallel + # queries to be run, or in running a data pipeline job, one fewer than the + # number of workers or compute instances available. + # @!attribute [rw] page_token + # @return [::String] + # The `next_page_token` value returned from a previous call to + # PartitionQuery that may be used to get an additional set of results. + # There are no ordering guarantees between sets of results. Thus, using + # multiple sets of results will require merging the different result sets. + # + # For example, two subsequent calls using a page_token may return: + # + # * cursor B, cursor M, cursor Q + # * cursor A, cursor U, cursor W + # + # To obtain a complete result set ordered with respect to the results of the + # query supplied to PartitionQuery, the results sets should be merged: + # cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of partitions to return in this call, subject to + # `partition_count`. + # + # For example, if `partition_count` = 10 and `page_size` = 8, the first call + # to PartitionQuery will return up to 8 partitions and a `next_page_token` + # if more results exist. A second call to PartitionQuery will return up to + # 2 partitions, to complete the total of 10 specified in `partition_count`. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Reads documents as they were at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + class PartitionQueryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Firestore::V1::Firestore::Client#partition_query Firestore.PartitionQuery}. + # @!attribute [rw] partitions + # @return [::Array<::Google::Cloud::Firestore::V1::Cursor>] + # Partition results. + # Each partition is a split point that can be used by RunQuery as a starting + # or end point for the query results. The RunQuery requests must be made with + # the same query supplied to this PartitionQuery request. The partition + # cursors will be ordered according to same ordering as the results of the + # query supplied to PartitionQuery. + # + # For example, if a PartitionQuery request returns partition cursors A and B, + # running the following three queries will return the entire result set of + # the original query: + # + # * query, end_at A + # * query, start_at A, end_at B + # * query, start_at B + # + # An empty result may indicate that the query has too few results to be + # partitioned, or that the query is not yet supported for partitioning. + # @!attribute [rw] next_page_token + # @return [::String] + # A page token that may be used to request an additional set of results, up + # to the number specified by `partition_count` in the PartitionQuery request. + # If blank, there are no more results. + class PartitionQueryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Firestore::V1::Firestore::Client#write Firestore.Write}. + # + # The first request creates a stream, or resumes an existing one from a token. + # + # When creating a new stream, the server replies with a response containing + # only an ID and a token, to use in the next request. + # + # When resuming a stream, the server first streams any responses later than the + # given token, then a response containing only an up-to-date token, to use in + # the next request. + # @!attribute [rw] database + # @return [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # This is only required in the first message. + # @!attribute [rw] stream_id + # @return [::String] + # The ID of the write stream to resume. + # This may only be set in the first message. When left empty, a new write + # stream will be created. + # @!attribute [rw] writes + # @return [::Array<::Google::Cloud::Firestore::V1::Write>] + # The writes to apply. + # + # Always executed atomically and in order. + # This must be empty on the first request. + # This may be empty on the last request. + # This must not be empty on all other requests. + # @!attribute [rw] stream_token + # @return [::String] + # A stream token that was previously sent by the server. + # + # The client should set this field to the token from the most recent + # {::Google::Cloud::Firestore::V1::WriteResponse WriteResponse} it has received. This + # acknowledges that the client has received responses up to this token. After + # sending this token, earlier tokens may not be used anymore. + # + # The server may close the stream if there are too many unacknowledged + # responses. + # + # Leave this field unset when creating a new stream. To resume a stream at + # a specific point, set this field and the `stream_id` field. + # + # Leave this field unset when creating a new stream. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels associated with this write request. + class WriteRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The response for {::Google::Cloud::Firestore::V1::Firestore::Client#write Firestore.Write}. + # @!attribute [rw] stream_id + # @return [::String] + # The ID of the stream. + # Only set on the first message, when a new stream was created. + # @!attribute [rw] stream_token + # @return [::String] + # A token that represents the position of this response in the stream. + # This can be used by a client to resume the stream at this point. + # + # This field is always set. + # @!attribute [rw] write_results + # @return [::Array<::Google::Cloud::Firestore::V1::WriteResult>] + # The result of applying the writes. + # + # This i-th write result corresponds to the i-th write in the + # request. + # @!attribute [rw] commit_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the commit occurred. Any read with an equal or greater + # `read_time` is guaranteed to see the effects of the write. + class WriteResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request for {::Google::Cloud::Firestore::V1::Firestore::Client#listen Firestore.Listen} + # @!attribute [rw] database + # @return [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @!attribute [rw] add_target + # @return [::Google::Cloud::Firestore::V1::Target] + # A target to add to this stream. + # + # Note: The following fields are mutually exclusive: `add_target`, `remove_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] remove_target + # @return [::Integer] + # The ID of a target to remove from this stream. + # + # Note: The following fields are mutually exclusive: `remove_target`, `add_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels associated with this target change. + class ListenRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The response for {::Google::Cloud::Firestore::V1::Firestore::Client#listen Firestore.Listen}. + # @!attribute [rw] target_change + # @return [::Google::Cloud::Firestore::V1::TargetChange] + # Targets have changed. + # + # Note: The following fields are mutually exclusive: `target_change`, `document_change`, `document_delete`, `document_remove`, `filter`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] document_change + # @return [::Google::Cloud::Firestore::V1::DocumentChange] + # A {::Google::Cloud::Firestore::V1::Document Document} has changed. + # + # Note: The following fields are mutually exclusive: `document_change`, `target_change`, `document_delete`, `document_remove`, `filter`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] document_delete + # @return [::Google::Cloud::Firestore::V1::DocumentDelete] + # A {::Google::Cloud::Firestore::V1::Document Document} has been deleted. + # + # Note: The following fields are mutually exclusive: `document_delete`, `target_change`, `document_change`, `document_remove`, `filter`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] document_remove + # @return [::Google::Cloud::Firestore::V1::DocumentRemove] + # A {::Google::Cloud::Firestore::V1::Document Document} has been removed from a target + # (because it is no longer relevant to that target). + # + # Note: The following fields are mutually exclusive: `document_remove`, `target_change`, `document_change`, `document_delete`, `filter`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] filter + # @return [::Google::Cloud::Firestore::V1::ExistenceFilter] + # A filter to apply to the set of documents previously returned for the + # given target. + # + # Returned when documents may have been removed from the given target, but + # the exact documents are unknown. + # + # Note: The following fields are mutually exclusive: `filter`, `target_change`, `document_change`, `document_delete`, `document_remove`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ListenResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A specification of a set of documents to listen to. + # @!attribute [rw] query + # @return [::Google::Cloud::Firestore::V1::Target::QueryTarget] + # A target specified by a query. + # + # Note: The following fields are mutually exclusive: `query`, `documents`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] documents + # @return [::Google::Cloud::Firestore::V1::Target::DocumentsTarget] + # A target specified by a set of document names. + # + # Note: The following fields are mutually exclusive: `documents`, `query`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] resume_token + # @return [::String] + # A resume token from a prior + # {::Google::Cloud::Firestore::V1::TargetChange TargetChange} for an identical target. + # + # Using a resume token with a different target is unsupported and may fail. + # + # Note: The following fields are mutually exclusive: `resume_token`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Start listening after a specific `read_time`. + # + # The client must know the state of matching documents at this time. + # + # Note: The following fields are mutually exclusive: `read_time`, `resume_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] target_id + # @return [::Integer] + # The target ID that identifies the target on the stream. Must be a positive + # number and non-zero. + # + # If `target_id` is 0 (or unspecified), the server will assign an ID for this + # target and return that in a `TargetChange::ADD` event. Once a target with + # `target_id=0` is added, all subsequent targets must also have + # `target_id=0`. If an `AddTarget` request with `target_id != 0` is + # sent to the server after a target with `target_id=0` is added, the server + # will immediately send a response with a `TargetChange::Remove` event. + # + # Note that if the client sends multiple `AddTarget` requests + # without an ID, the order of IDs returned in `TargetChange.target_ids` are + # undefined. Therefore, clients should provide a target ID instead of relying + # on the server to assign one. + # + # If `target_id` is non-zero, there must not be an existing active target on + # this stream with the same ID. + # @!attribute [rw] once + # @return [::Boolean] + # If the target should be removed once it is current and consistent. + # @!attribute [rw] expected_count + # @return [::Google::Protobuf::Int32Value] + # The number of documents that last matched the query at the resume token or + # read time. + # + # This value is only relevant when a `resume_type` is provided. This value + # being present and greater than zero signals that the client wants + # `ExistenceFilter.unchanged_names` to be included in the response. + class Target + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A target specified by a set of documents names. + # @!attribute [rw] documents + # @return [::Array<::String>] + # The names of the documents to retrieve. In the format: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # The request will fail if any of the document is not a child resource of + # the given `database`. Duplicate names will be elided. + class DocumentsTarget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A target specified by a query. + # @!attribute [rw] parent + # @return [::String] + # The parent resource name. In the format: + # `projects/{project_id}/databases/{database_id}/documents` or + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # For example: + # `projects/my-project/databases/my-database/documents` or + # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + # @!attribute [rw] structured_query + # @return [::Google::Cloud::Firestore::V1::StructuredQuery] + # A structured query. + class QueryTarget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Targets being watched have changed. + # @!attribute [rw] target_change_type + # @return [::Google::Cloud::Firestore::V1::TargetChange::TargetChangeType] + # The type of change that occurred. + # @!attribute [rw] target_ids + # @return [::Array<::Integer>] + # The target IDs of targets that have changed. + # + # If empty, the change applies to all targets. + # + # The order of the target IDs is not defined. + # @!attribute [rw] cause + # @return [::Google::Rpc::Status] + # The error that resulted in this change, if applicable. + # @!attribute [rw] resume_token + # @return [::String] + # A token that can be used to resume the stream for the given `target_ids`, + # or all targets if `target_ids` is empty. + # + # Not set on every target change. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # The consistent `read_time` for the given `target_ids` (omitted when the + # target_ids are not at a consistent snapshot). + # + # The stream is guaranteed to send a `read_time` with `target_ids` empty + # whenever the entire stream reaches a new consistent snapshot. ADD, + # CURRENT, and RESET messages are guaranteed to (eventually) result in a + # new consistent snapshot (while NO_CHANGE and REMOVE messages are not). + # + # For a given stream, `read_time` is guaranteed to be monotonically + # increasing. + class TargetChange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of change. + module TargetChangeType + # No change has occurred. Used only to send an updated `resume_token`. + NO_CHANGE = 0 + + # The targets have been added. + ADD = 1 + + # The targets have been removed. + REMOVE = 2 + + # The targets reflect all changes committed before the targets were added + # to the stream. + # + # This will be sent after or with a `read_time` that is greater than or + # equal to the time at which the targets were added. + # + # Listeners can wait for this change if read-after-write semantics + # are desired. + CURRENT = 3 + + # The targets have been reset, and a new initial state for the targets + # will be returned in subsequent changes. + # + # After the initial state is complete, `CURRENT` will be returned even + # if the target was previously indicated to be `CURRENT`. + RESET = 4 + end + end + + # The request for + # {::Google::Cloud::Firestore::V1::Firestore::Client#list_collection_ids Firestore.ListCollectionIds}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent document. In the format: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # For example: + # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return. + # @!attribute [rw] page_token + # @return [::String] + # A page token. Must be a value from + # {::Google::Cloud::Firestore::V1::ListCollectionIdsResponse ListCollectionIdsResponse}. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Reads documents as they were at the given time. + # + # This must be a microsecond precision timestamp within the past one hour, + # or if Point-in-Time Recovery is enabled, can additionally be a whole + # minute timestamp within the past 7 days. + class ListCollectionIdsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response from + # {::Google::Cloud::Firestore::V1::Firestore::Client#list_collection_ids Firestore.ListCollectionIds}. + # @!attribute [rw] collection_ids + # @return [::Array<::String>] + # The collection ids. + # @!attribute [rw] next_page_token + # @return [::String] + # A page token that may be used to continue the list. + class ListCollectionIdsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Firestore::V1::Firestore::Client#batch_write Firestore.BatchWrite}. + # @!attribute [rw] database + # @return [::String] + # Required. The database name. In the format: + # `projects/{project_id}/databases/{database_id}`. + # @!attribute [rw] writes + # @return [::Array<::Google::Cloud::Firestore::V1::Write>] + # The writes to apply. + # + # Method does not apply writes atomically and does not guarantee ordering. + # Each write succeeds or fails independently. You cannot write to the same + # document more than once per request. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels associated with this batch write. + class BatchWriteRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The response from + # {::Google::Cloud::Firestore::V1::Firestore::Client#batch_write Firestore.BatchWrite}. + # @!attribute [rw] write_results + # @return [::Array<::Google::Cloud::Firestore::V1::WriteResult>] + # The result of applying the writes. + # + # This i-th write result corresponds to the i-th write in the + # request. + # @!attribute [rw] status + # @return [::Array<::Google::Rpc::Status>] + # The status of applying the writes. + # + # This i-th write status corresponds to the i-th write in the + # request. + class BatchWriteResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/pipeline.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/pipeline.rb new file mode 100644 index 000000000000..f46ac594fed8 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/pipeline.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Firestore + module V1 + # A Firestore query represented as an ordered list of operations / stages. + # + # This is considered the top-level function which plans and executes a query. + # It is logically equivalent to `query(stages, options)`, but prevents the + # client from having to build a function wrapper. + # @!attribute [rw] pipeline + # @return [::Google::Cloud::Firestore::V1::Pipeline] + # Required. The pipeline query to execute. + # @!attribute [rw] options + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}] + # Optional. Optional query-level arguments. + class StructuredPipeline + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Firestore::V1::Value] + class OptionsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query.rb new file mode 100644 index 000000000000..88beb633529b --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query.rb @@ -0,0 +1,629 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Firestore + module V1 + # A Firestore query. + # + # The query stages are executed in the following order: + # 1. from + # 2. where + # 3. select + # 4. order_by + start_at + end_at + # 5. offset + # 6. limit + # 7. find_nearest + # @!attribute [rw] select + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::Projection] + # Optional sub-set of the fields to return. + # + # This acts as a {::Google::Cloud::Firestore::V1::DocumentMask DocumentMask} over the + # documents returned from a query. When not set, assumes that the caller + # wants all fields returned. + # @!attribute [rw] from + # @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::CollectionSelector>] + # The collections to query. + # @!attribute [rw] where + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::Filter] + # The filter to apply. + # @!attribute [rw] order_by + # @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::Order>] + # The order to apply to the query results. + # + # Firestore allows callers to provide a full ordering, a partial ordering, or + # no ordering at all. In all cases, Firestore guarantees a stable ordering + # through the following rules: + # + # * The `order_by` is required to reference all fields used with an + # inequality filter. + # * All fields that are required to be in the `order_by` but are not already + # present are appended in lexicographical ordering of the field name. + # * If an order on `__name__` is not specified, it is appended by default. + # + # Fields are appended with the same sort direction as the last order + # specified, or 'ASCENDING' if no order was specified. For example: + # + # * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` + # * `ORDER BY a DESC` becomes `ORDER BY a DESC, __name__ DESC` + # * `WHERE a > 1` becomes `WHERE a > 1 ORDER BY a ASC, __name__ ASC` + # * `WHERE __name__ > ... AND a > 1` becomes + # `WHERE __name__ > ... AND a > 1 ORDER BY a ASC, __name__ ASC` + # @!attribute [rw] start_at + # @return [::Google::Cloud::Firestore::V1::Cursor] + # A potential prefix of a position in the result set to start the query at. + # + # The ordering of the result set is based on the `ORDER BY` clause of the + # original query. + # + # ``` + # SELECT * FROM k WHERE a = 1 AND b > 2 ORDER BY b ASC, __name__ ASC; + # ``` + # + # This query's results are ordered by `(b ASC, __name__ ASC)`. + # + # Cursors can reference either the full ordering or a prefix of the location, + # though it cannot reference more fields than what are in the provided + # `ORDER BY`. + # + # Continuing off the example above, attaching the following start cursors + # will have varying impact: + # + # - `START BEFORE (2, /k/123)`: start the query right before `a = 1 AND + # b > 2 AND __name__ > /k/123`. + # - `START AFTER (10)`: start the query right after `a = 1 AND b > 10`. + # + # Unlike `OFFSET` which requires scanning over the first N results to skip, + # a start cursor allows the query to begin at a logical position. This + # position is not required to match an actual result, it will scan forward + # from this position to find the next document. + # + # Requires: + # + # * The number of values cannot be greater than the number of fields + # specified in the `ORDER BY` clause. + # @!attribute [rw] end_at + # @return [::Google::Cloud::Firestore::V1::Cursor] + # A potential prefix of a position in the result set to end the query at. + # + # This is similar to `START_AT` but with it controlling the end position + # rather than the start position. + # + # Requires: + # + # * The number of values cannot be greater than the number of fields + # specified in the `ORDER BY` clause. + # @!attribute [rw] offset + # @return [::Integer] + # The number of documents to skip before returning the first result. + # + # This applies after the constraints specified by the `WHERE`, `START AT`, & + # `END AT` but before the `LIMIT` clause. + # + # Requires: + # + # * The value must be greater than or equal to zero if specified. + # @!attribute [rw] limit + # @return [::Google::Protobuf::Int32Value] + # The maximum number of results to return. + # + # Applies after all other constraints. + # + # Requires: + # + # * The value must be greater than or equal to zero if specified. + # @!attribute [rw] find_nearest + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FindNearest] + # Optional. A potential nearest neighbors search. + # + # Applies after all other filters and ordering. + # + # Finds the closest vector embeddings to the given query vector. + class StructuredQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A selection of a collection, such as `messages as m1`. + # @!attribute [rw] collection_id + # @return [::String] + # The collection ID. + # When set, selects only collections with this ID. + # @!attribute [rw] all_descendants + # @return [::Boolean] + # When false, selects only collections that are immediate children of + # the `parent` specified in the containing `RunQueryRequest`. + # When true, selects all descendant collections. + class CollectionSelector + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A filter. + # @!attribute [rw] composite_filter + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter] + # A composite filter. + # + # Note: The following fields are mutually exclusive: `composite_filter`, `field_filter`, `unary_filter`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] field_filter + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter] + # A filter on a document field. + # + # Note: The following fields are mutually exclusive: `field_filter`, `composite_filter`, `unary_filter`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] unary_filter + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter] + # A filter that takes exactly one argument. + # + # Note: The following fields are mutually exclusive: `unary_filter`, `composite_filter`, `field_filter`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Filter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A filter that merges multiple other filters using the given operator. + # @!attribute [rw] op + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter::Operator] + # The operator for combining multiple filters. + # @!attribute [rw] filters + # @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::Filter>] + # The list of filters to combine. + # + # Requires: + # + # * At least one filter is present. + class CompositeFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A composite filter operator. + module Operator + # Unspecified. This value must not be used. + OPERATOR_UNSPECIFIED = 0 + + # Documents are required to satisfy all of the combined filters. + AND = 1 + + # Documents are required to satisfy at least one of the combined filters. + OR = 2 + end + end + + # A filter on a specific field. + # @!attribute [rw] field + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference] + # The field to filter by. + # @!attribute [rw] op + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter::Operator] + # The operator to filter by. + # @!attribute [rw] value + # @return [::Google::Cloud::Firestore::V1::Value] + # The value to compare to. + class FieldFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A field filter operator. + module Operator + # Unspecified. This value must not be used. + OPERATOR_UNSPECIFIED = 0 + + # The given `field` is less than the given `value`. + # + # Requires: + # + # * That `field` come first in `order_by`. + LESS_THAN = 1 + + # The given `field` is less than or equal to the given `value`. + # + # Requires: + # + # * That `field` come first in `order_by`. + LESS_THAN_OR_EQUAL = 2 + + # The given `field` is greater than the given `value`. + # + # Requires: + # + # * That `field` come first in `order_by`. + GREATER_THAN = 3 + + # The given `field` is greater than or equal to the given `value`. + # + # Requires: + # + # * That `field` come first in `order_by`. + GREATER_THAN_OR_EQUAL = 4 + + # The given `field` is equal to the given `value`. + EQUAL = 5 + + # The given `field` is not equal to the given `value`. + # + # Requires: + # + # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`. + # * That `field` comes first in the `order_by`. + NOT_EQUAL = 6 + + # The given `field` is an array that contains the given `value`. + ARRAY_CONTAINS = 7 + + # The given `field` is equal to at least one value in the given array. + # + # Requires: + # + # * That `value` is a non-empty `ArrayValue`, subject to disjunction + # limits. + # * No `NOT_IN` filters in the same query. + IN = 8 + + # The given `field` is an array that contains any of the values in the + # given array. + # + # Requires: + # + # * That `value` is a non-empty `ArrayValue`, subject to disjunction + # limits. + # * No other `ARRAY_CONTAINS_ANY` filters within the same disjunction. + # * No `NOT_IN` filters in the same query. + ARRAY_CONTAINS_ANY = 9 + + # The value of the `field` is not in the given array. + # + # Requires: + # + # * That `value` is a non-empty `ArrayValue` with at most 10 values. + # * No other `OR`, `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`, `NOT_EQUAL`, + # `IS_NOT_NULL`, or `IS_NOT_NAN`. + # * That `field` comes first in the `order_by`. + NOT_IN = 10 + end + end + + # A filter with a single operand. + # @!attribute [rw] op + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter::Operator] + # The unary operator to apply. + # @!attribute [rw] field + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference] + # The field to which to apply the operator. + class UnaryFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A unary operator. + module Operator + # Unspecified. This value must not be used. + OPERATOR_UNSPECIFIED = 0 + + # The given `field` is equal to `NaN`. + IS_NAN = 2 + + # The given `field` is equal to `NULL`. + IS_NULL = 3 + + # The given `field` is not equal to `NaN`. + # + # Requires: + # + # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`. + # * That `field` comes first in the `order_by`. + IS_NOT_NAN = 4 + + # The given `field` is not equal to `NULL`. + # + # Requires: + # + # * A single `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`. + # * That `field` comes first in the `order_by`. + IS_NOT_NULL = 5 + end + end + + # An order on a field. + # @!attribute [rw] field + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference] + # The field to order by. + # @!attribute [rw] direction + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::Direction] + # The direction to order by. Defaults to `ASCENDING`. + class Order + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A reference to a field in a document, ex: `stats.operations`. + # @!attribute [rw] field_path + # @return [::String] + # A reference to a field in a document. + # + # Requires: + # + # * MUST be a dot-delimited (`.`) string of segments, where each segment + # conforms to {::Google::Cloud::Firestore::V1::Document#fields document field name} + # limitations. + class FieldReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The projection of document's fields to return. + # @!attribute [rw] fields + # @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference>] + # The fields to return. + # + # If empty, all fields are returned. To only return the name + # of the document, use `['__name__']`. + class Projection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Nearest Neighbors search config. The ordering provided by FindNearest + # supersedes the order_by stage. If multiple documents have the same vector + # distance, the returned document order is not guaranteed to be stable + # between queries. + # @!attribute [rw] vector_field + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference] + # Required. An indexed vector field to search upon. Only documents which + # contain vectors whose dimensionality match the query_vector can be + # returned. + # @!attribute [rw] query_vector + # @return [::Google::Cloud::Firestore::V1::Value] + # Required. The query vector that we are searching on. Must be a vector of + # no more than 2048 dimensions. + # @!attribute [rw] distance_measure + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FindNearest::DistanceMeasure] + # Required. The distance measure to use, required. + # @!attribute [rw] limit + # @return [::Google::Protobuf::Int32Value] + # Required. The number of nearest neighbors to return. Must be a positive + # integer of no more than 1000. + # @!attribute [rw] distance_result_field + # @return [::String] + # Optional. Optional name of the field to output the result of the vector + # distance calculation. Must conform to [document field + # name][google.firestore.v1.Document.fields] limitations. + # @!attribute [rw] distance_threshold + # @return [::Google::Protobuf::DoubleValue] + # Optional. Option to specify a threshold for which no less similar + # documents will be returned. The behavior of the specified + # `distance_measure` will affect the meaning of the distance threshold. + # Since DOT_PRODUCT distances increase when the vectors are more similar, + # the comparison is inverted. + # + # * For EUCLIDEAN, COSINE: `WHERE distance <= distance_threshold` + # * For DOT_PRODUCT: `WHERE distance >= distance_threshold` + class FindNearest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The distance measure to use when comparing vectors. + module DistanceMeasure + # Should not be set. + DISTANCE_MEASURE_UNSPECIFIED = 0 + + # Measures the EUCLIDEAN distance between the vectors. See + # [Euclidean](https://en.wikipedia.org/wiki/Euclidean_distance) to learn + # more. The resulting distance decreases the more similar two vectors + # are. + EUCLIDEAN = 1 + + # COSINE distance compares vectors based on the angle between them, which + # allows you to measure similarity that isn't based on the vectors + # magnitude. We recommend using DOT_PRODUCT with unit normalized vectors + # instead of COSINE distance, which is mathematically equivalent with + # better performance. See [Cosine + # Similarity](https://en.wikipedia.org/wiki/Cosine_similarity) to learn + # more about COSINE similarity and COSINE distance. The resulting + # COSINE distance decreases the more similar two vectors are. + COSINE = 2 + + # Similar to cosine but is affected by the magnitude of the vectors. See + # [Dot Product](https://en.wikipedia.org/wiki/Dot_product) to learn more. + # The resulting distance increases the more similar two vectors are. + DOT_PRODUCT = 3 + end + end + + # A sort direction. + module Direction + # Unspecified. + DIRECTION_UNSPECIFIED = 0 + + # Ascending. + ASCENDING = 1 + + # Descending. + DESCENDING = 2 + end + end + + # Firestore query for running an aggregation over a + # {::Google::Cloud::Firestore::V1::StructuredQuery StructuredQuery}. + # @!attribute [rw] structured_query + # @return [::Google::Cloud::Firestore::V1::StructuredQuery] + # Nested structured query. + # @!attribute [rw] aggregations + # @return [::Array<::Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation>] + # Optional. Series of aggregations to apply over the results of the + # `structured_query`. + # + # Requires: + # + # * A minimum of one and maximum of five aggregations per query. + class StructuredAggregationQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines an aggregation that produces a single result. + # @!attribute [rw] count + # @return [::Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation::Count] + # Count aggregator. + # + # Note: The following fields are mutually exclusive: `count`, `sum`, `avg`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] sum + # @return [::Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation::Sum] + # Sum aggregator. + # + # Note: The following fields are mutually exclusive: `sum`, `count`, `avg`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] avg + # @return [::Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation::Avg] + # Average aggregator. + # + # Note: The following fields are mutually exclusive: `avg`, `count`, `sum`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] alias + # @return [::String] + # Optional. Optional name of the field to store the result of the + # aggregation into. + # + # If not provided, Firestore will pick a default name following the format + # `field_`. For example: + # + # ``` + # AGGREGATE + # COUNT_UP_TO(1) AS count_up_to_1, + # COUNT_UP_TO(2), + # COUNT_UP_TO(3) AS count_up_to_3, + # COUNT(*) + # OVER ( + # ... + # ); + # ``` + # + # becomes: + # + # ``` + # AGGREGATE + # COUNT_UP_TO(1) AS count_up_to_1, + # COUNT_UP_TO(2) AS field_1, + # COUNT_UP_TO(3) AS count_up_to_3, + # COUNT(*) AS field_2 + # OVER ( + # ... + # ); + # ``` + # + # Requires: + # + # * Must be unique across all aggregation aliases. + # * Conform to {::Google::Cloud::Firestore::V1::Document#fields document field name} + # limitations. + class Aggregation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Count of documents that match the query. + # + # The `COUNT(*)` aggregation function operates on the entire document + # so it does not require a field reference. + # @!attribute [rw] up_to + # @return [::Google::Protobuf::Int64Value] + # Optional. Optional constraint on the maximum number of documents to + # count. + # + # This provides a way to set an upper bound on the number of documents + # to scan, limiting latency, and cost. + # + # Unspecified is interpreted as no bound. + # + # High-Level Example: + # + # ``` + # AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + # ``` + # + # Requires: + # + # * Must be greater than zero when present. + class Count + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Sum of the values of the requested field. + # + # * Only numeric values will be aggregated. All non-numeric values + # including `NULL` are skipped. + # + # * If the aggregated values contain `NaN`, returns `NaN`. Infinity math + # follows IEEE-754 standards. + # + # * If the aggregated value set is empty, returns 0. + # + # * Returns a 64-bit integer if all aggregated numbers are integers and the + # sum result does not overflow. Otherwise, the result is returned as a + # double. Note that even if all the aggregated values are integers, the + # result is returned as a double if it cannot fit within a 64-bit signed + # integer. When this occurs, the returned value will lose precision. + # + # * When underflow occurs, floating-point aggregation is non-deterministic. + # This means that running the same query repeatedly without any changes to + # the underlying values could produce slightly different results each + # time. In those cases, values should be stored as integers over + # floating-point numbers. + # @!attribute [rw] field + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference] + # The field to aggregate on. + class Sum + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Average of the values of the requested field. + # + # * Only numeric values will be aggregated. All non-numeric values + # including `NULL` are skipped. + # + # * If the aggregated values contain `NaN`, returns `NaN`. Infinity math + # follows IEEE-754 standards. + # + # * If the aggregated value set is empty, returns `NULL`. + # + # * Always returns the result as a double. + # @!attribute [rw] field + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference] + # The field to aggregate on. + class Avg + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # A position in a query result set. + # @!attribute [rw] values + # @return [::Array<::Google::Cloud::Firestore::V1::Value>] + # The values that represent a position, in the order they appear in + # the order by clause of a query. + # + # Can contain fewer values than specified in the order by clause. + # @!attribute [rw] before + # @return [::Boolean] + # If the position is just before or just after the given values, relative + # to the sort order defined by the query. + class Cursor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query_profile.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query_profile.rb new file mode 100644 index 000000000000..2c04e4f0a820 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query_profile.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Firestore + module V1 + # Explain options for the query. + # @!attribute [rw] analyze + # @return [::Boolean] + # Optional. Whether to execute this query. + # + # When false (the default), the query will be planned, returning only + # metrics from the planning stages. + # + # When true, the query will be planned and executed, returning the full + # query results along with both planning and execution stage metrics. + class ExplainOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Explain metrics for the query. + # @!attribute [rw] plan_summary + # @return [::Google::Cloud::Firestore::V1::PlanSummary] + # Planning phase information for the query. + # @!attribute [rw] execution_stats + # @return [::Google::Cloud::Firestore::V1::ExecutionStats] + # Aggregated stats from the execution of the query. Only present when + # {::Google::Cloud::Firestore::V1::ExplainOptions#analyze ExplainOptions.analyze} is set + # to true. + class ExplainMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Planning phase information for the query. + # @!attribute [rw] indexes_used + # @return [::Array<::Google::Protobuf::Struct>] + # The indexes selected for the query. For example: + # [ + # \\{"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, + # \\{"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} + # ] + class PlanSummary + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Execution statistics for the query. + # @!attribute [rw] results_returned + # @return [::Integer] + # Total number of results returned, including documents, projections, + # aggregation results, keys. + # @!attribute [rw] execution_duration + # @return [::Google::Protobuf::Duration] + # Total time to execute the query in the backend. + # @!attribute [rw] read_operations + # @return [::Integer] + # Total billable read operations. + # @!attribute [rw] debug_stats + # @return [::Google::Protobuf::Struct] + # Debugging statistics from the execution of the query. Note that the + # debugging stats are subject to change as Firestore evolves. It could + # include: + # { + # "indexes_entries_scanned": "1000", + # "documents_scanned": "20", + # "billing_details" : { + # "documents_billable": "20", + # "index_entries_billable": "1000", + # "min_query_cost": "0" + # } + # } + class ExecutionStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/write.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/write.rb new file mode 100644 index 000000000000..ee5975f34b2c --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/write.rb @@ -0,0 +1,317 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Firestore + module V1 + # A write on a document. + # @!attribute [rw] update + # @return [::Google::Cloud::Firestore::V1::Document] + # A document to write. + # + # Note: The following fields are mutually exclusive: `update`, `delete`, `transform`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] delete + # @return [::String] + # A document name to delete. In the format: + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # + # Note: The following fields are mutually exclusive: `delete`, `update`, `transform`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] transform + # @return [::Google::Cloud::Firestore::V1::DocumentTransform] + # Applies a transformation to a document. + # + # Note: The following fields are mutually exclusive: `transform`, `update`, `delete`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] update_mask + # @return [::Google::Cloud::Firestore::V1::DocumentMask] + # The fields to update in this write. + # + # This field can be set only when the operation is `update`. + # If the mask is not set for an `update` and the document exists, any + # existing data will be overwritten. + # If the mask is set and the document on the server has fields not covered by + # the mask, they are left unchanged. + # Fields referenced in the mask, but not present in the input document, are + # deleted from the document on the server. + # The field paths in this mask must not contain a reserved field name. + # @!attribute [rw] update_transforms + # @return [::Array<::Google::Cloud::Firestore::V1::DocumentTransform::FieldTransform>] + # The transforms to perform after update. + # + # This field can be set only when the operation is `update`. If present, this + # write is equivalent to performing `update` and `transform` to the same + # document atomically and in order. + # @!attribute [rw] current_document + # @return [::Google::Cloud::Firestore::V1::Precondition] + # An optional precondition on the document. + # + # The write will fail if this is set and not met by the target document. + class Write + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A transformation of a document. + # @!attribute [rw] document + # @return [::String] + # The name of the document to transform. + # @!attribute [rw] field_transforms + # @return [::Array<::Google::Cloud::Firestore::V1::DocumentTransform::FieldTransform>] + # The list of transformations to apply to the fields of the document, in + # order. + # This must not be empty. + class DocumentTransform + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A transformation of a field of the document. + # @!attribute [rw] field_path + # @return [::String] + # The path of the field. See + # {::Google::Cloud::Firestore::V1::Document#fields Document.fields} for the field path + # syntax reference. + # @!attribute [rw] set_to_server_value + # @return [::Google::Cloud::Firestore::V1::DocumentTransform::FieldTransform::ServerValue] + # Sets the field to the given server value. + # + # Note: The following fields are mutually exclusive: `set_to_server_value`, `increment`, `maximum`, `minimum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] increment + # @return [::Google::Cloud::Firestore::V1::Value] + # Adds the given value to the field's current value. + # + # This must be an integer or a double value. + # If the field is not an integer or double, or if the field does not yet + # exist, the transformation will set the field to the given value. + # If either of the given value or the current field value are doubles, + # both values will be interpreted as doubles. Double arithmetic and + # representation of double values follow IEEE 754 semantics. + # If there is positive/negative integer overflow, the field is resolved + # to the largest magnitude positive/negative integer. + # + # Note: The following fields are mutually exclusive: `increment`, `set_to_server_value`, `maximum`, `minimum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] maximum + # @return [::Google::Cloud::Firestore::V1::Value] + # Sets the field to the maximum of its current value and the given value. + # + # This must be an integer or a double value. + # If the field is not an integer or double, or if the field does not yet + # exist, the transformation will set the field to the given value. + # If a maximum operation is applied where the field and the input value + # are of mixed types (that is - one is an integer and one is a double) + # the field takes on the type of the larger operand. If the operands are + # equivalent (e.g. 3 and 3.0), the field does not change. + # 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and + # zero input value is always the stored value. + # The maximum of any numeric value x and NaN is NaN. + # + # Note: The following fields are mutually exclusive: `maximum`, `set_to_server_value`, `increment`, `minimum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] minimum + # @return [::Google::Cloud::Firestore::V1::Value] + # Sets the field to the minimum of its current value and the given value. + # + # This must be an integer or a double value. + # If the field is not an integer or double, or if the field does not yet + # exist, the transformation will set the field to the input value. + # If a minimum operation is applied where the field and the input value + # are of mixed types (that is - one is an integer and one is a double) + # the field takes on the type of the smaller operand. If the operands are + # equivalent (e.g. 3 and 3.0), the field does not change. + # 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and + # zero input value is always the stored value. + # The minimum of any numeric value x and NaN is NaN. + # + # Note: The following fields are mutually exclusive: `minimum`, `set_to_server_value`, `increment`, `maximum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] append_missing_elements + # @return [::Google::Cloud::Firestore::V1::ArrayValue] + # Append the given elements in order if they are not already present in + # the current field value. + # If the field is not an array, or if the field does not yet exist, it is + # first set to the empty array. + # + # Equivalent numbers of different types (e.g. 3L and 3.0) are + # considered equal when checking if a value is missing. + # NaN is equal to NaN, and Null is equal to Null. + # If the input contains multiple equivalent values, only the first will + # be considered. + # + # The corresponding transform_result will be the null value. + # + # Note: The following fields are mutually exclusive: `append_missing_elements`, `set_to_server_value`, `increment`, `maximum`, `minimum`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] remove_all_from_array + # @return [::Google::Cloud::Firestore::V1::ArrayValue] + # Remove all of the given elements from the array in the field. + # If the field is not an array, or if the field does not yet exist, it is + # set to the empty array. + # + # Equivalent numbers of the different types (e.g. 3L and 3.0) are + # considered equal when deciding whether an element should be removed. + # NaN is equal to NaN, and Null is equal to Null. + # This will remove all equivalent values if there are duplicates. + # + # The corresponding transform_result will be the null value. + # + # Note: The following fields are mutually exclusive: `remove_all_from_array`, `set_to_server_value`, `increment`, `maximum`, `minimum`, `append_missing_elements`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class FieldTransform + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A value that is calculated by the server. + module ServerValue + # Unspecified. This value must not be used. + SERVER_VALUE_UNSPECIFIED = 0 + + # The time at which the server processed the request, with millisecond + # precision. If used on multiple fields (same or different documents) in + # a transaction, all the fields will get the same server timestamp. + REQUEST_TIME = 1 + end + end + end + + # The result of applying a write. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The last update time of the document after applying the write. Not set + # after a `delete`. + # + # If the write did not actually change the document, this will be the + # previous update_time. + # @!attribute [rw] transform_results + # @return [::Array<::Google::Cloud::Firestore::V1::Value>] + # The results of applying each + # {::Google::Cloud::Firestore::V1::DocumentTransform::FieldTransform DocumentTransform.FieldTransform}, + # in the same order. + class WriteResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A {::Google::Cloud::Firestore::V1::Document Document} has changed. + # + # May be the result of multiple {::Google::Cloud::Firestore::V1::Write writes}, including + # deletes, that ultimately resulted in a new value for the + # {::Google::Cloud::Firestore::V1::Document Document}. + # + # Multiple {::Google::Cloud::Firestore::V1::DocumentChange DocumentChange} messages may be + # returned for the same logical change, if multiple targets are affected. + # @!attribute [rw] document + # @return [::Google::Cloud::Firestore::V1::Document] + # The new state of the {::Google::Cloud::Firestore::V1::Document Document}. + # + # If `mask` is set, contains only fields that were updated or added. + # @!attribute [rw] target_ids + # @return [::Array<::Integer>] + # A set of target IDs of targets that match this document. + # @!attribute [rw] removed_target_ids + # @return [::Array<::Integer>] + # A set of target IDs for targets that no longer match this document. + class DocumentChange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A {::Google::Cloud::Firestore::V1::Document Document} has been deleted. + # + # May be the result of multiple {::Google::Cloud::Firestore::V1::Write writes}, including + # updates, the last of which deleted the + # {::Google::Cloud::Firestore::V1::Document Document}. + # + # Multiple {::Google::Cloud::Firestore::V1::DocumentDelete DocumentDelete} messages may be + # returned for the same logical delete, if multiple targets are affected. + # @!attribute [rw] document + # @return [::String] + # The resource name of the {::Google::Cloud::Firestore::V1::Document Document} that was + # deleted. + # @!attribute [rw] removed_target_ids + # @return [::Array<::Integer>] + # A set of target IDs for targets that previously matched this entity. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # The read timestamp at which the delete was observed. + # + # Greater or equal to the `commit_time` of the delete. + class DocumentDelete + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A {::Google::Cloud::Firestore::V1::Document Document} has been removed from the view of + # the targets. + # + # Sent if the document is no longer relevant to a target and is out of view. + # Can be sent instead of a DocumentDelete or a DocumentChange if the server + # can not send the new value of the document. + # + # Multiple {::Google::Cloud::Firestore::V1::DocumentRemove DocumentRemove} messages may be + # returned for the same logical write or delete, if multiple targets are + # affected. + # @!attribute [rw] document + # @return [::String] + # The resource name of the {::Google::Cloud::Firestore::V1::Document Document} that has + # gone out of view. + # @!attribute [rw] removed_target_ids + # @return [::Array<::Integer>] + # A set of target IDs for targets that previously matched this document. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # The read timestamp at which the remove was observed. + # + # Greater or equal to the `commit_time` of the change/delete/remove. + class DocumentRemove + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A digest of all the documents that match a given target. + # @!attribute [rw] target_id + # @return [::Integer] + # The target ID to which this filter applies. + # @!attribute [rw] count + # @return [::Integer] + # The total count of documents that match + # {::Google::Cloud::Firestore::V1::ExistenceFilter#target_id target_id}. + # + # If different from the count of documents in the client that match, the + # client must manually determine which documents no longer match the target. + # + # The client can use the `unchanged_names` bloom filter to assist with + # this determination by testing ALL the document names against the filter; + # if the document name is NOT in the filter, it means the document no + # longer matches the target. + # @!attribute [rw] unchanged_names + # @return [::Google::Cloud::Firestore::V1::BloomFilter] + # A bloom filter that, despite its name, contains the UTF-8 byte encodings of + # the resource names of ALL the documents that match + # {::Google::Cloud::Firestore::V1::ExistenceFilter#target_id target_id}, in the form + # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + # + # This bloom filter may be omitted at the server's discretion, such as if it + # is deemed that the client will not make use of it or if it is too + # computationally expensive to calculate or transmit. Clients must gracefully + # handle this field being absent by falling back to the logic used before + # this field existed; that is, re-add the target without a resume token to + # figure out which documents in the client's cache are out of sync. + class ExistenceFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/struct.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Struct` represents a structured data value, consisting of fields + # which map to dynamically typed values. In some languages, `Struct` + # might be supported by a native representation. For example, in + # scripting languages like JS a struct is represented as an + # object. The details of that representation are described together + # with the proto support for the language. + # + # The JSON representation for `Struct` is JSON object. + # @!attribute [rw] fields + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Unordered map of dynamically typed values. + class Struct + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class FieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `Value` represents a dynamically typed value which can be either + # null, a number, a string, a boolean, a recursive struct value, or a + # list of values. A producer of value is expected to set one of these + # variants. Absence of any variant indicates an error. + # + # The JSON representation for `Value` is JSON value. + # @!attribute [rw] null_value + # @return [::Google::Protobuf::NullValue] + # Represents a null value. + # + # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] number_value + # @return [::Float] + # Represents a double value. + # + # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] string_value + # @return [::String] + # Represents a string value. + # + # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bool_value + # @return [::Boolean] + # Represents a boolean value. + # + # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] struct_value + # @return [::Google::Protobuf::Struct] + # Represents a structured value. + # + # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] list_value + # @return [::Google::Protobuf::ListValue] + # Represents a repeated `Value`. + # + # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `ListValue` is a wrapper around a repeated field of values. + # + # The JSON representation for `ListValue` is JSON array. + # @!attribute [rw] values + # @return [::Array<::Google::Protobuf::Value>] + # Repeated field of dynamically typed values. + class ListValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `NullValue` is a singleton enumeration to represent the null value for the + # `Value` type union. + # + # The JSON representation for `NullValue` is JSON `null`. + module NullValue + # Null value. + NULL_VALUE = 0 + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..1b485b0c3456 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # Wrapper message for `double`. + # + # The JSON representation for `DoubleValue` is JSON number. + # @!attribute [rw] value + # @return [::Float] + # The double value. + class DoubleValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `float`. + # + # The JSON representation for `FloatValue` is JSON number. + # @!attribute [rw] value + # @return [::Float] + # The float value. + class FloatValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int64`. + # + # The JSON representation for `Int64Value` is JSON string. + # @!attribute [rw] value + # @return [::Integer] + # The int64 value. + class Int64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint64`. + # + # The JSON representation for `UInt64Value` is JSON string. + # @!attribute [rw] value + # @return [::Integer] + # The uint64 value. + class UInt64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int32`. + # + # The JSON representation for `Int32Value` is JSON number. + # @!attribute [rw] value + # @return [::Integer] + # The int32 value. + class Int32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint32`. + # + # The JSON representation for `UInt32Value` is JSON number. + # @!attribute [rw] value + # @return [::Integer] + # The uint32 value. + class UInt32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bool`. + # + # The JSON representation for `BoolValue` is JSON `true` and `false`. + # @!attribute [rw] value + # @return [::Boolean] + # The bool value. + class BoolValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `string`. + # + # The JSON representation for `StringValue` is JSON string. + # @!attribute [rw] value + # @return [::String] + # The string value. + class StringValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bytes`. + # + # The JSON representation for `BytesValue` is JSON string. + # @!attribute [rw] value + # @return [::String] + # The bytes value. + class BytesValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/type/latlng.rb new file mode 100644 index 000000000000..c15e78a39a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/type/latlng.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # An object that represents a latitude/longitude pair. This is expressed as a + # pair of doubles to represent degrees latitude and degrees longitude. Unless + # specified otherwise, this must conform to the + # WGS84 + # standard. Values must be within normalized ranges. + # @!attribute [rw] latitude + # @return [::Float] + # The latitude in degrees. It must be in the range [-90.0, +90.0]. + # @!attribute [rw] longitude + # @return [::Float] + # The longitude in degrees. It must be in the range [-180.0, +180.0]. + class LatLng + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-firestore-v1/snippets/Gemfile new file mode 100644 index 000000000000..6aafafebdfaa --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-firestore-v1", path: "../" +else + gem "google-cloud-firestore-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-v1/snippets/firestore/batch_get_documents.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/batch_get_documents.rb new file mode 100644 index 000000000000..f71efdc2f1b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/batch_get_documents.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_BatchGetDocuments_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the batch_get_documents call in the Firestore 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::V1::Firestore::Client#batch_get_documents. +# +def batch_get_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new + + # Call the batch_get_documents method to start streaming. + output = client.batch_get_documents request + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse + output.each do |current_response| + p current_response + end +end +# [END firestore_v1_generated_Firestore_BatchGetDocuments_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/batch_write.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/batch_write.rb new file mode 100644 index 000000000000..93e3a3f3ac99 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/batch_write.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_BatchWrite_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the batch_write call in the Firestore 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::V1::Firestore::Client#batch_write. +# +def batch_write + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::BatchWriteRequest.new + + # Call the batch_write method. + result = client.batch_write request + + # The returned object is of type Google::Cloud::Firestore::V1::BatchWriteResponse. + p result +end +# [END firestore_v1_generated_Firestore_BatchWrite_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/begin_transaction.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/begin_transaction.rb new file mode 100644 index 000000000000..110bf9f094b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/begin_transaction.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_BeginTransaction_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the begin_transaction call in the Firestore 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::V1::Firestore::Client#begin_transaction. +# +def begin_transaction + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::BeginTransactionRequest.new + + # Call the begin_transaction method. + result = client.begin_transaction request + + # The returned object is of type Google::Cloud::Firestore::V1::BeginTransactionResponse. + p result +end +# [END firestore_v1_generated_Firestore_BeginTransaction_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/commit.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/commit.rb new file mode 100644 index 000000000000..728f621b5c42 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/commit.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_Commit_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the commit call in the Firestore 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::V1::Firestore::Client#commit. +# +def commit + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::CommitRequest.new + + # Call the commit method. + result = client.commit request + + # The returned object is of type Google::Cloud::Firestore::V1::CommitResponse. + p result +end +# [END firestore_v1_generated_Firestore_Commit_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/create_document.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/create_document.rb new file mode 100644 index 000000000000..91b0ca458e0b --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/create_document.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_CreateDocument_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the create_document call in the Firestore 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::V1::Firestore::Client#create_document. +# +def create_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::CreateDocumentRequest.new + + # Call the create_document method. + result = client.create_document request + + # The returned object is of type Google::Cloud::Firestore::V1::Document. + p result +end +# [END firestore_v1_generated_Firestore_CreateDocument_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/delete_document.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/delete_document.rb new file mode 100644 index 000000000000..58f88b2364df --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/delete_document.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_DeleteDocument_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the delete_document call in the Firestore 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::V1::Firestore::Client#delete_document. +# +def delete_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::DeleteDocumentRequest.new + + # Call the delete_document method. + result = client.delete_document request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END firestore_v1_generated_Firestore_DeleteDocument_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/execute_pipeline.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/execute_pipeline.rb new file mode 100644 index 000000000000..2113693e5c50 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/execute_pipeline.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_ExecutePipeline_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the execute_pipeline call in the Firestore 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::V1::Firestore::Client#execute_pipeline. +# +def execute_pipeline + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::ExecutePipelineRequest.new + + # Call the execute_pipeline method to start streaming. + output = client.execute_pipeline request + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Firestore::V1::ExecutePipelineResponse + output.each do |current_response| + p current_response + end +end +# [END firestore_v1_generated_Firestore_ExecutePipeline_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/get_document.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/get_document.rb new file mode 100644 index 000000000000..6b7bb9690798 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/get_document.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_GetDocument_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the get_document call in the Firestore 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::V1::Firestore::Client#get_document. +# +def get_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::GetDocumentRequest.new + + # Call the get_document method. + result = client.get_document request + + # The returned object is of type Google::Cloud::Firestore::V1::Document. + p result +end +# [END firestore_v1_generated_Firestore_GetDocument_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_collection_ids.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_collection_ids.rb new file mode 100644 index 000000000000..9fd9635f9731 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_collection_ids.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_ListCollectionIds_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the list_collection_ids call in the Firestore 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::V1::Firestore::Client#list_collection_ids. +# +def list_collection_ids + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new + + # Call the list_collection_ids method. + result = client.list_collection_ids request + + # The returned object is of type Google::Cloud::Firestore::V1::ListCollectionIdsResponse. + p result +end +# [END firestore_v1_generated_Firestore_ListCollectionIds_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_documents.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_documents.rb new file mode 100644 index 000000000000..50b574e03e61 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_documents.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_ListDocuments_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the list_documents call in the Firestore 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::V1::Firestore::Client#list_documents. +# +def list_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::ListDocumentsRequest.new + + # Call the list_documents method. + result = client.list_documents 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::V1::Document. + p item + end +end +# [END firestore_v1_generated_Firestore_ListDocuments_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/listen.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/listen.rb new file mode 100644 index 000000000000..d704f8f68040 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/listen.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_Listen_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the listen call in the Firestore 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::V1::Firestore::Client#listen. +# +def listen + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the listen method to start streaming. + output = client.listen input + + # Send requests on the stream. For each request object, set fields by + # passing keyword arguments. Be sure to close the stream when done. + input << Google::Cloud::Firestore::V1::ListenRequest.new + input << Google::Cloud::Firestore::V1::ListenRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Firestore::V1::ListenResponse + output.each do |current_response| + p current_response + end +end +# [END firestore_v1_generated_Firestore_Listen_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/partition_query.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/partition_query.rb new file mode 100644 index 000000000000..3b642ca7464a --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/partition_query.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_PartitionQuery_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the partition_query call in the Firestore 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::V1::Firestore::Client#partition_query. +# +def partition_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::PartitionQueryRequest.new + + # Call the partition_query method. + result = client.partition_query 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::V1::Cursor. + p item + end +end +# [END firestore_v1_generated_Firestore_PartitionQuery_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/rollback.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/rollback.rb new file mode 100644 index 000000000000..5a48928fa963 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/rollback.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_Rollback_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the rollback call in the Firestore 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::V1::Firestore::Client#rollback. +# +def rollback + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::RollbackRequest.new + + # Call the rollback method. + result = client.rollback request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END firestore_v1_generated_Firestore_Rollback_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_aggregation_query.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_aggregation_query.rb new file mode 100644 index 000000000000..feb15a4d908f --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_aggregation_query.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_RunAggregationQuery_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the run_aggregation_query call in the Firestore 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::V1::Firestore::Client#run_aggregation_query. +# +def run_aggregation_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new + + # Call the run_aggregation_query method to start streaming. + output = client.run_aggregation_query request + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse + output.each do |current_response| + p current_response + end +end +# [END firestore_v1_generated_Firestore_RunAggregationQuery_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_query.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_query.rb new file mode 100644 index 000000000000..741c1e754894 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_query.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_RunQuery_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the run_query call in the Firestore 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::V1::Firestore::Client#run_query. +# +def run_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::RunQueryRequest.new + + # Call the run_query method to start streaming. + output = client.run_query request + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Firestore::V1::RunQueryResponse + output.each do |current_response| + p current_response + end +end +# [END firestore_v1_generated_Firestore_RunQuery_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/update_document.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/update_document.rb new file mode 100644 index 000000000000..c1c4d96bad4b --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/update_document.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_UpdateDocument_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the update_document call in the Firestore 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::V1::Firestore::Client#update_document. +# +def update_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::UpdateDocumentRequest.new + + # Call the update_document method. + result = client.update_document request + + # The returned object is of type Google::Cloud::Firestore::V1::Document. + p result +end +# [END firestore_v1_generated_Firestore_UpdateDocument_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/write.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/write.rb new file mode 100644 index 000000000000..55103736dd0e --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/write.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START firestore_v1_generated_Firestore_Write_sync] +require "google/cloud/firestore/v1" + +## +# Snippet for the write call in the Firestore 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::V1::Firestore::Client#write. +# +def write + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the write method to start streaming. + output = client.write input + + # Send requests on the stream. For each request object, set fields by + # passing keyword arguments. Be sure to close the stream when done. + input << Google::Cloud::Firestore::V1::WriteRequest.new + input << Google::Cloud::Firestore::V1::WriteRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Firestore::V1::WriteResponse + output.each do |current_response| + p current_response + end +end +# [END firestore_v1_generated_Firestore_Write_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/snippet_metadata_google.firestore.v1.json b/owl-bot-staging/google-cloud-firestore-v1/snippets/snippet_metadata_google.firestore.v1.json new file mode 100644 index 000000000000..87be441de1ce --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/snippets/snippet_metadata_google.firestore.v1.json @@ -0,0 +1,695 @@ +{ + "client_library": { + "name": "google-cloud-firestore-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.firestore.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "firestore_v1_generated_Firestore_GetDocument_sync", + "title": "Snippet for the get_document call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#get_document.", + "file": "firestore/get_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_document", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#get_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::GetDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::V1::Document", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "GetDocument", + "full_name": "google.firestore.v1.Firestore.GetDocument", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_ListDocuments_sync", + "title": "Snippet for the list_documents call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#list_documents.", + "file": "firestore/list_documents.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_documents", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#list_documents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::ListDocumentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::V1::ListDocumentsResponse", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "ListDocuments", + "full_name": "google.firestore.v1.Firestore.ListDocuments", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_UpdateDocument_sync", + "title": "Snippet for the update_document call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#update_document.", + "file": "firestore/update_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_document", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#update_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::UpdateDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::V1::Document", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "UpdateDocument", + "full_name": "google.firestore.v1.Firestore.UpdateDocument", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_DeleteDocument_sync", + "title": "Snippet for the delete_document call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#delete_document.", + "file": "firestore/delete_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_document", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#delete_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::DeleteDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "DeleteDocument", + "full_name": "google.firestore.v1.Firestore.DeleteDocument", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_BatchGetDocuments_sync", + "title": "Snippet for the batch_get_documents call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#batch_get_documents.", + "file": "firestore/batch_get_documents.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_get_documents", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#batch_get_documents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "BatchGetDocuments", + "full_name": "google.firestore.v1.Firestore.BatchGetDocuments", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 49, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_BeginTransaction_sync", + "title": "Snippet for the begin_transaction call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#begin_transaction.", + "file": "firestore/begin_transaction.rb", + "language": "RUBY", + "client_method": { + "short_name": "begin_transaction", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#begin_transaction", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::BeginTransactionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::V1::BeginTransactionResponse", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "BeginTransaction", + "full_name": "google.firestore.v1.Firestore.BeginTransaction", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_Commit_sync", + "title": "Snippet for the commit call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#commit.", + "file": "firestore/commit.rb", + "language": "RUBY", + "client_method": { + "short_name": "commit", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#commit", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::CommitRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::V1::CommitResponse", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "Commit", + "full_name": "google.firestore.v1.Firestore.Commit", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_Rollback_sync", + "title": "Snippet for the rollback call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#rollback.", + "file": "firestore/rollback.rb", + "language": "RUBY", + "client_method": { + "short_name": "rollback", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#rollback", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::RollbackRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "Rollback", + "full_name": "google.firestore.v1.Firestore.Rollback", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_RunQuery_sync", + "title": "Snippet for the run_query call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#run_query.", + "file": "firestore/run_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_query", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#run_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::RunQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::V1::RunQueryResponse", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "RunQuery", + "full_name": "google.firestore.v1.Firestore.RunQuery", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 49, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_ExecutePipeline_sync", + "title": "Snippet for the execute_pipeline call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#execute_pipeline.", + "file": "firestore/execute_pipeline.rb", + "language": "RUBY", + "client_method": { + "short_name": "execute_pipeline", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#execute_pipeline", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::ExecutePipelineRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::V1::ExecutePipelineResponse", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "ExecutePipeline", + "full_name": "google.firestore.v1.Firestore.ExecutePipeline", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 49, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_RunAggregationQuery_sync", + "title": "Snippet for the run_aggregation_query call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#run_aggregation_query.", + "file": "firestore/run_aggregation_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_aggregation_query", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#run_aggregation_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::RunAggregationQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::V1::RunAggregationQueryResponse", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "RunAggregationQuery", + "full_name": "google.firestore.v1.Firestore.RunAggregationQuery", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 49, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_PartitionQuery_sync", + "title": "Snippet for the partition_query call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#partition_query.", + "file": "firestore/partition_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "partition_query", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#partition_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::PartitionQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::V1::PartitionQueryResponse", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "PartitionQuery", + "full_name": "google.firestore.v1.Firestore.PartitionQuery", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_Write_sync", + "title": "Snippet for the write call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#write.", + "file": "firestore/write.rb", + "language": "RUBY", + "client_method": { + "short_name": "write", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#write", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::WriteRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::V1::WriteResponse", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "Write", + "full_name": "google.firestore.v1.Firestore.Write", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_Listen_sync", + "title": "Snippet for the listen call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#listen.", + "file": "firestore/listen.rb", + "language": "RUBY", + "client_method": { + "short_name": "listen", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#listen", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::ListenRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::V1::ListenResponse", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "Listen", + "full_name": "google.firestore.v1.Firestore.Listen", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_ListCollectionIds_sync", + "title": "Snippet for the list_collection_ids call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#list_collection_ids.", + "file": "firestore/list_collection_ids.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_collection_ids", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#list_collection_ids", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::ListCollectionIdsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::V1::ListCollectionIdsResponse", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "ListCollectionIds", + "full_name": "google.firestore.v1.Firestore.ListCollectionIds", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_BatchWrite_sync", + "title": "Snippet for the batch_write call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#batch_write.", + "file": "firestore/batch_write.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_write", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#batch_write", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::BatchWriteRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::V1::BatchWriteResponse", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "BatchWrite", + "full_name": "google.firestore.v1.Firestore.BatchWrite", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "firestore_v1_generated_Firestore_CreateDocument_sync", + "title": "Snippet for the create_document call in the Firestore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#create_document.", + "file": "firestore/create_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_document", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#create_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Firestore::V1::CreateDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Firestore::V1::Document", + "client": { + "short_name": "Firestore::Client", + "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" + }, + "method": { + "short_name": "CreateDocument", + "full_name": "google.firestore.v1.Firestore.CreateDocument", + "service": { + "short_name": "Firestore", + "full_name": "google.firestore.v1.Firestore" + } + } + }, + "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-v1/test/google/cloud/firestore/v1/firestore_rest_test.rb b/owl-bot-staging/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_rest_test.rb new file mode 100644 index 000000000000..f743e99d9d50 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_rest_test.rb @@ -0,0 +1,951 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/firestore/v1/firestore_pb" +require "google/cloud/firestore/v1/firestore/rest" + + +class ::Google::Cloud::Firestore::V1::Firestore::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_document + # Create test objects. + client_result = ::Google::Cloud::Firestore::V1::Document.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + mask = {} + transaction = "hello world" + + get_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_get_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_document_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_document({ name: name, mask: mask, transaction: transaction }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_document name: name, mask: mask, transaction: transaction do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_document ::Google::Cloud::Firestore::V1::GetDocumentRequest.new(name: name, mask: mask, transaction: transaction) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_document({ name: name, mask: mask, transaction: transaction }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_document(::Google::Cloud::Firestore::V1::GetDocumentRequest.new(name: name, mask: mask, transaction: transaction), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_document_client_stub.call_count + end + end + end + + def test_list_documents + # Create test objects. + client_result = ::Google::Cloud::Firestore::V1::ListDocumentsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + collection_id = "hello world" + page_size = 42 + page_token = "hello world" + order_by = "hello world" + mask = {} + transaction = "hello world" + show_missing = true + + list_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_list_documents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_documents_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_documents({ parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_documents parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_documents ::Google::Cloud::Firestore::V1::ListDocumentsRequest.new(parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_documents({ parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_documents(::Google::Cloud::Firestore::V1::ListDocumentsRequest.new(parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_documents_client_stub.call_count + end + end + end + + def test_update_document + # Create test objects. + client_result = ::Google::Cloud::Firestore::V1::Document.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + document = {} + update_mask = {} + mask = {} + current_document = {} + + update_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_update_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_document_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_document({ document: document, update_mask: update_mask, mask: mask, current_document: current_document }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_document document: document, update_mask: update_mask, mask: mask, current_document: current_document do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_document ::Google::Cloud::Firestore::V1::UpdateDocumentRequest.new(document: document, update_mask: update_mask, mask: mask, current_document: current_document) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_document({ document: document, update_mask: update_mask, mask: mask, current_document: current_document }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_document(::Google::Cloud::Firestore::V1::UpdateDocumentRequest.new(document: document, update_mask: update_mask, mask: mask, current_document: current_document), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_document_client_stub.call_count + end + end + end + + def test_delete_document + # 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" + current_document = {} + + delete_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_delete_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_document_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_document({ name: name, current_document: current_document }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_document name: name, current_document: current_document do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_document ::Google::Cloud::Firestore::V1::DeleteDocumentRequest.new(name: name, current_document: current_document) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_document({ name: name, current_document: current_document }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_document(::Google::Cloud::Firestore::V1::DeleteDocumentRequest.new(name: name, current_document: current_document), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_document_client_stub.call_count + end + end + end + + def test_batch_get_documents + # Create test objects. + client_result = ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + database = "hello world" + documents = ["hello world"] + mask = {} + transaction = "hello world" + + batch_get_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_batch_get_documents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_get_documents_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_get_documents({ database: database, documents: documents, mask: mask, transaction: transaction }) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use named arguments + client.batch_get_documents database: database, documents: documents, mask: mask, transaction: transaction do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object + client.batch_get_documents ::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new(database: database, documents: documents, mask: mask, transaction: transaction) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use hash object with options + client.batch_get_documents({ database: database, documents: documents, mask: mask, transaction: transaction }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object with options + client.batch_get_documents(::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new(database: database, documents: documents, mask: mask, transaction: transaction), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Verify method calls + assert_equal 5, batch_get_documents_client_stub.call_count + end + end + end + + def test_begin_transaction + # Create test objects. + client_result = ::Google::Cloud::Firestore::V1::BeginTransactionResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + database = "hello world" + options = {} + + begin_transaction_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_begin_transaction_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, begin_transaction_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.begin_transaction({ database: database, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.begin_transaction database: database, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.begin_transaction ::Google::Cloud::Firestore::V1::BeginTransactionRequest.new(database: database, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.begin_transaction({ database: database, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.begin_transaction(::Google::Cloud::Firestore::V1::BeginTransactionRequest.new(database: database, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, begin_transaction_client_stub.call_count + end + end + end + + def test_commit + # Create test objects. + client_result = ::Google::Cloud::Firestore::V1::CommitResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + database = "hello world" + writes = [{}] + transaction = "hello world" + + commit_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_commit_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, commit_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.commit({ database: database, writes: writes, transaction: transaction }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.commit database: database, writes: writes, transaction: transaction do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.commit ::Google::Cloud::Firestore::V1::CommitRequest.new(database: database, writes: writes, transaction: transaction) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.commit({ database: database, writes: writes, transaction: transaction }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.commit(::Google::Cloud::Firestore::V1::CommitRequest.new(database: database, writes: writes, transaction: transaction), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, commit_client_stub.call_count + end + end + end + + def test_rollback + # 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. + database = "hello world" + transaction = "hello world" + + rollback_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_rollback_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, rollback_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.rollback({ database: database, transaction: transaction }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.rollback database: database, transaction: transaction do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.rollback ::Google::Cloud::Firestore::V1::RollbackRequest.new(database: database, transaction: transaction) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.rollback({ database: database, transaction: transaction }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.rollback(::Google::Cloud::Firestore::V1::RollbackRequest.new(database: database, transaction: transaction), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, rollback_client_stub.call_count + end + end + end + + def test_run_query + # Create test objects. + client_result = ::Google::Cloud::Firestore::V1::RunQueryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + structured_query = {} + transaction = "hello world" + explain_options = {} + + run_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_run_query_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, run_query_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_query({ parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options }) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use named arguments + client.run_query parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object + client.run_query ::Google::Cloud::Firestore::V1::RunQueryRequest.new(parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use hash object with options + client.run_query({ parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object with options + client.run_query(::Google::Cloud::Firestore::V1::RunQueryRequest.new(parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Verify method calls + assert_equal 5, run_query_client_stub.call_count + end + end + end + + def test_execute_pipeline + # Create test objects. + client_result = ::Google::Cloud::Firestore::V1::ExecutePipelineResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + database = "hello world" + structured_pipeline = {} + transaction = "hello world" + + execute_pipeline_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_execute_pipeline_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, execute_pipeline_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.execute_pipeline({ database: database, structured_pipeline: structured_pipeline, transaction: transaction }) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use named arguments + client.execute_pipeline database: database, structured_pipeline: structured_pipeline, transaction: transaction do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object + client.execute_pipeline ::Google::Cloud::Firestore::V1::ExecutePipelineRequest.new(database: database, structured_pipeline: structured_pipeline, transaction: transaction) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use hash object with options + client.execute_pipeline({ database: database, structured_pipeline: structured_pipeline, transaction: transaction }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object with options + client.execute_pipeline(::Google::Cloud::Firestore::V1::ExecutePipelineRequest.new(database: database, structured_pipeline: structured_pipeline, transaction: transaction), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Verify method calls + assert_equal 5, execute_pipeline_client_stub.call_count + end + end + end + + def test_run_aggregation_query + # Create test objects. + client_result = ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + structured_aggregation_query = {} + transaction = "hello world" + explain_options = {} + + run_aggregation_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_run_aggregation_query_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, run_aggregation_query_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_aggregation_query({ parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options }) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use named arguments + client.run_aggregation_query parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object + client.run_aggregation_query ::Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new(parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use hash object with options + client.run_aggregation_query({ parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object with options + client.run_aggregation_query(::Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new(parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Verify method calls + assert_equal 5, run_aggregation_query_client_stub.call_count + end + end + end + + def test_partition_query + # Create test objects. + client_result = ::Google::Cloud::Firestore::V1::PartitionQueryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + structured_query = {} + partition_count = 42 + page_token = "hello world" + page_size = 42 + read_time = {} + + partition_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_partition_query_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, partition_query_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.partition_query({ parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.partition_query parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.partition_query ::Google::Cloud::Firestore::V1::PartitionQueryRequest.new(parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.partition_query({ parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.partition_query(::Google::Cloud::Firestore::V1::PartitionQueryRequest.new(parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, partition_query_client_stub.call_count + end + end + end + + def test_list_collection_ids + # Create test objects. + client_result = ::Google::Cloud::Firestore::V1::ListCollectionIdsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + read_time = {} + + list_collection_ids_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_list_collection_ids_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_collection_ids_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_collection_ids({ parent: parent, page_size: page_size, page_token: page_token, read_time: read_time }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_collection_ids parent: parent, page_size: page_size, page_token: page_token, read_time: read_time do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_collection_ids ::Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new(parent: parent, page_size: page_size, page_token: page_token, read_time: read_time) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_collection_ids({ parent: parent, page_size: page_size, page_token: page_token, read_time: read_time }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_collection_ids(::Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new(parent: parent, page_size: page_size, page_token: page_token, read_time: read_time), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_collection_ids_client_stub.call_count + end + end + end + + def test_batch_write + # Create test objects. + client_result = ::Google::Cloud::Firestore::V1::BatchWriteResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + database = "hello world" + writes = [{}] + labels = {} + + batch_write_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_batch_write_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_write_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_write({ database: database, writes: writes, labels: labels }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_write database: database, writes: writes, labels: labels do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_write ::Google::Cloud::Firestore::V1::BatchWriteRequest.new(database: database, writes: writes, labels: labels) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_write({ database: database, writes: writes, labels: labels }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_write(::Google::Cloud::Firestore::V1::BatchWriteRequest.new(database: database, writes: writes, labels: labels), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_write_client_stub.call_count + end + end + end + + def test_create_document + # Create test objects. + client_result = ::Google::Cloud::Firestore::V1::Document.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + collection_id = "hello world" + document_id = "hello world" + document = {} + mask = {} + + create_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_create_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_document_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_document({ parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_document parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_document ::Google::Cloud::Firestore::V1::CreateDocumentRequest.new(parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_document({ parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_document(::Google::Cloud::Firestore::V1::CreateDocumentRequest.new(parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_document_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::V1::Firestore::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::V1::Firestore::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_test.rb b/owl-bot-staging/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_test.rb new file mode 100644 index 000000000000..2c489e91476d --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_test.rb @@ -0,0 +1,1329 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/firestore/v1/firestore_pb" +require "google/cloud/firestore/v1/firestore" + +class ::Google::Cloud::Firestore::V1::Firestore::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_document + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::V1::Document.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" + mask = {} + transaction = "hello world" + + get_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_document, name + assert_kind_of ::Google::Cloud::Firestore::V1::GetDocumentRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::DocumentMask), request["mask"] + assert_equal "hello world", request["transaction"] + assert_equal :transaction, request.consistency_selector + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_document_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_document({ name: name, mask: mask, transaction: transaction }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_document name: name, mask: mask, transaction: transaction do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_document ::Google::Cloud::Firestore::V1::GetDocumentRequest.new(name: name, mask: mask, transaction: transaction) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_document({ name: name, mask: mask, transaction: transaction }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_document(::Google::Cloud::Firestore::V1::GetDocumentRequest.new(name: name, mask: mask, transaction: transaction), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_document_client_stub.call_rpc_count + end + end + + def test_list_documents + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::V1::ListDocumentsResponse.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" + collection_id = "hello world" + page_size = 42 + page_token = "hello world" + order_by = "hello world" + mask = {} + transaction = "hello world" + show_missing = true + + list_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_documents, name + assert_kind_of ::Google::Cloud::Firestore::V1::ListDocumentsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["collection_id"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["order_by"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::DocumentMask), request["mask"] + assert_equal "hello world", request["transaction"] + assert_equal :transaction, request.consistency_selector + assert_equal true, request["show_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_documents_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_documents({ parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing }) 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_documents parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing 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_documents ::Google::Cloud::Firestore::V1::ListDocumentsRequest.new(parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing) 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_documents({ parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing }, 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_documents(::Google::Cloud::Firestore::V1::ListDocumentsRequest.new(parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing), 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_documents_client_stub.call_rpc_count + end + end + + def test_update_document + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::V1::Document.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. + document = {} + update_mask = {} + mask = {} + current_document = {} + + update_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_document, name + assert_kind_of ::Google::Cloud::Firestore::V1::UpdateDocumentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::Document), request["document"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::DocumentMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::DocumentMask), request["mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::Precondition), request["current_document"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_document_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_document({ document: document, update_mask: update_mask, mask: mask, current_document: current_document }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_document document: document, update_mask: update_mask, mask: mask, current_document: current_document do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_document ::Google::Cloud::Firestore::V1::UpdateDocumentRequest.new(document: document, update_mask: update_mask, mask: mask, current_document: current_document) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_document({ document: document, update_mask: update_mask, mask: mask, current_document: current_document }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_document(::Google::Cloud::Firestore::V1::UpdateDocumentRequest.new(document: document, update_mask: update_mask, mask: mask, current_document: current_document), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_document_client_stub.call_rpc_count + end + end + + def test_delete_document + # 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" + current_document = {} + + delete_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_document, name + assert_kind_of ::Google::Cloud::Firestore::V1::DeleteDocumentRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::Precondition), request["current_document"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_document_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_document({ name: name, current_document: current_document }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_document name: name, current_document: current_document do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_document ::Google::Cloud::Firestore::V1::DeleteDocumentRequest.new(name: name, current_document: current_document) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_document({ name: name, current_document: current_document }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_document(::Google::Cloud::Firestore::V1::DeleteDocumentRequest.new(name: name, current_document: current_document), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_document_client_stub.call_rpc_count + end + end + + def test_batch_get_documents + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a server streaming method. + database = "hello world" + documents = ["hello world"] + mask = {} + transaction = "hello world" + + batch_get_documents_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :batch_get_documents, name + assert_kind_of ::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest, request + assert_equal "hello world", request["database"] + assert_equal ["hello world"], request["documents"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::DocumentMask), request["mask"] + assert_equal "hello world", request["transaction"] + assert_equal :transaction, request.consistency_selector + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_get_documents_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_get_documents({ database: database, documents: documents, mask: mask, transaction: transaction }) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse, r + end + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_get_documents database: database, documents: documents, mask: mask, transaction: transaction do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_get_documents ::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new(database: database, documents: documents, mask: mask, transaction: transaction) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse, r + end + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_get_documents({ database: database, documents: documents, mask: mask, transaction: transaction }, grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_get_documents(::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new(database: database, documents: documents, mask: mask, transaction: transaction), grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse, r + end + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_get_documents_client_stub.call_rpc_count + end + end + + def test_begin_transaction + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::V1::BeginTransactionResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = "hello world" + options = {} + + begin_transaction_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :begin_transaction, name + assert_kind_of ::Google::Cloud::Firestore::V1::BeginTransactionRequest, request + assert_equal "hello world", request["database"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::TransactionOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, begin_transaction_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.begin_transaction({ database: database, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.begin_transaction database: database, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.begin_transaction ::Google::Cloud::Firestore::V1::BeginTransactionRequest.new(database: database, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.begin_transaction({ database: database, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.begin_transaction(::Google::Cloud::Firestore::V1::BeginTransactionRequest.new(database: database, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, begin_transaction_client_stub.call_rpc_count + end + end + + def test_commit + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::V1::CommitResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = "hello world" + writes = [{}] + transaction = "hello world" + + commit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :commit, name + assert_kind_of ::Google::Cloud::Firestore::V1::CommitRequest, request + assert_equal "hello world", request["database"] + assert_kind_of ::Google::Cloud::Firestore::V1::Write, request["writes"].first + assert_equal "hello world", request["transaction"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, commit_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.commit({ database: database, writes: writes, transaction: transaction }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.commit database: database, writes: writes, transaction: transaction do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.commit ::Google::Cloud::Firestore::V1::CommitRequest.new(database: database, writes: writes, transaction: transaction) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.commit({ database: database, writes: writes, transaction: transaction }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.commit(::Google::Cloud::Firestore::V1::CommitRequest.new(database: database, writes: writes, transaction: transaction), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, commit_client_stub.call_rpc_count + end + end + + def test_rollback + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = "hello world" + transaction = "hello world" + + rollback_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :rollback, name + assert_kind_of ::Google::Cloud::Firestore::V1::RollbackRequest, request + assert_equal "hello world", request["database"] + assert_equal "hello world", request["transaction"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, rollback_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.rollback({ database: database, transaction: transaction }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.rollback database: database, transaction: transaction do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.rollback ::Google::Cloud::Firestore::V1::RollbackRequest.new(database: database, transaction: transaction) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.rollback({ database: database, transaction: transaction }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.rollback(::Google::Cloud::Firestore::V1::RollbackRequest.new(database: database, transaction: transaction), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, rollback_client_stub.call_rpc_count + end + end + + def test_run_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::V1::RunQueryResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a server streaming method. + parent = "hello world" + structured_query = {} + transaction = "hello world" + explain_options = {} + + run_query_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :run_query, name + assert_kind_of ::Google::Cloud::Firestore::V1::RunQueryRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::StructuredQuery), request["structured_query"] + assert_equal :structured_query, request.query_type + assert_equal "hello world", request["transaction"] + assert_equal :transaction, request.consistency_selector + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::ExplainOptions), request["explain_options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_query_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_query({ parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options }) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::RunQueryResponse, r + end + assert_equal grpc_operation, operation + end + + # Use named arguments + client.run_query parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::RunQueryResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.run_query ::Google::Cloud::Firestore::V1::RunQueryRequest.new(parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::RunQueryResponse, r + end + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.run_query({ parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options }, grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::RunQueryResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.run_query(::Google::Cloud::Firestore::V1::RunQueryRequest.new(parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options), grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::RunQueryResponse, r + end + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, run_query_client_stub.call_rpc_count + end + end + + def test_execute_pipeline + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::V1::ExecutePipelineResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a server streaming method. + database = "hello world" + structured_pipeline = {} + transaction = "hello world" + + execute_pipeline_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :execute_pipeline, name + assert_kind_of ::Google::Cloud::Firestore::V1::ExecutePipelineRequest, request + assert_equal "hello world", request["database"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::StructuredPipeline), request["structured_pipeline"] + assert_equal :structured_pipeline, request.pipeline_type + assert_equal "hello world", request["transaction"] + assert_equal :transaction, request.consistency_selector + refute_nil options + end + + Gapic::ServiceStub.stub :new, execute_pipeline_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.execute_pipeline({ database: database, structured_pipeline: structured_pipeline, transaction: transaction }) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::ExecutePipelineResponse, r + end + assert_equal grpc_operation, operation + end + + # Use named arguments + client.execute_pipeline database: database, structured_pipeline: structured_pipeline, transaction: transaction do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::ExecutePipelineResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.execute_pipeline ::Google::Cloud::Firestore::V1::ExecutePipelineRequest.new(database: database, structured_pipeline: structured_pipeline, transaction: transaction) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::ExecutePipelineResponse, r + end + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.execute_pipeline({ database: database, structured_pipeline: structured_pipeline, transaction: transaction }, grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::ExecutePipelineResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.execute_pipeline(::Google::Cloud::Firestore::V1::ExecutePipelineRequest.new(database: database, structured_pipeline: structured_pipeline, transaction: transaction), grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::ExecutePipelineResponse, r + end + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, execute_pipeline_client_stub.call_rpc_count + end + end + + def test_run_aggregation_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a server streaming method. + parent = "hello world" + structured_aggregation_query = {} + transaction = "hello world" + explain_options = {} + + run_aggregation_query_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :run_aggregation_query, name + assert_kind_of ::Google::Cloud::Firestore::V1::RunAggregationQueryRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::StructuredAggregationQuery), request["structured_aggregation_query"] + assert_equal :structured_aggregation_query, request.query_type + assert_equal "hello world", request["transaction"] + assert_equal :transaction, request.consistency_selector + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::ExplainOptions), request["explain_options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_aggregation_query_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_aggregation_query({ parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options }) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse, r + end + assert_equal grpc_operation, operation + end + + # Use named arguments + client.run_aggregation_query parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.run_aggregation_query ::Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new(parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse, r + end + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.run_aggregation_query({ parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options }, grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.run_aggregation_query(::Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new(parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options), grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse, r + end + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, run_aggregation_query_client_stub.call_rpc_count + end + end + + def test_partition_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::V1::PartitionQueryResponse.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" + structured_query = {} + partition_count = 42 + page_token = "hello world" + page_size = 42 + read_time = {} + + partition_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :partition_query, name + assert_kind_of ::Google::Cloud::Firestore::V1::PartitionQueryRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::StructuredQuery), request["structured_query"] + assert_equal :structured_query, request.query_type + assert_equal 42, request["partition_count"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] + assert_equal :read_time, request.consistency_selector + refute_nil options + end + + Gapic::ServiceStub.stub :new, partition_query_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.partition_query({ parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time }) 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.partition_query parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time 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.partition_query ::Google::Cloud::Firestore::V1::PartitionQueryRequest.new(parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time) 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.partition_query({ parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time }, 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.partition_query(::Google::Cloud::Firestore::V1::PartitionQueryRequest.new(parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time), 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, partition_query_client_stub.call_rpc_count + end + end + + def test_write + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::V1::WriteResponse.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 bidi streaming method. + database = "hello world" + stream_id = "hello world" + writes = [{}] + stream_token = "hello world" + labels = {} + + write_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :write, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, write_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels } + request_proto = ::Google::Cloud::Firestore::V1::WriteRequest.new database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels + enum_input = [request_hash, request_proto].to_enum + client.write enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::WriteResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels } + request_proto = ::Google::Cloud::Firestore::V1::WriteRequest.new database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels + stream_input = Gapic::StreamInput.new + client.write stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::WriteResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Use enumerable object with hash and protobuf object with options. + request_hash = { database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels } + request_proto = ::Google::Cloud::Firestore::V1::WriteRequest.new database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels + enum_input = [request_hash, request_proto].to_enum + client.write enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::WriteResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels } + request_proto = ::Google::Cloud::Firestore::V1::WriteRequest.new database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels + stream_input = Gapic::StreamInput.new + client.write stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::WriteResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Verify method calls + assert_equal 4, write_client_stub.call_rpc_count + write_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::WriteRequest, r + assert_equal "hello world", r["database"] + assert_equal "hello world", r["stream_id"] + assert_kind_of ::Google::Cloud::Firestore::V1::Write, r["writes"].first + assert_equal "hello world", r["stream_token"] + assert_equal({}, r["labels"].to_h) + end + end + end + end + + def test_listen + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::V1::ListenResponse.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 bidi streaming method. + database = "hello world" + add_target = {} + labels = {} + + listen_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :listen, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, listen_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { database: database, add_target: add_target, labels: labels } + request_proto = ::Google::Cloud::Firestore::V1::ListenRequest.new database: database, add_target: add_target, labels: labels + enum_input = [request_hash, request_proto].to_enum + client.listen enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::ListenResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { database: database, add_target: add_target, labels: labels } + request_proto = ::Google::Cloud::Firestore::V1::ListenRequest.new database: database, add_target: add_target, labels: labels + stream_input = Gapic::StreamInput.new + client.listen stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::ListenResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Use enumerable object with hash and protobuf object with options. + request_hash = { database: database, add_target: add_target, labels: labels } + request_proto = ::Google::Cloud::Firestore::V1::ListenRequest.new database: database, add_target: add_target, labels: labels + enum_input = [request_hash, request_proto].to_enum + client.listen enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::ListenResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { database: database, add_target: add_target, labels: labels } + request_proto = ::Google::Cloud::Firestore::V1::ListenRequest.new database: database, add_target: add_target, labels: labels + stream_input = Gapic::StreamInput.new + client.listen stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::ListenResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Verify method calls + assert_equal 4, listen_client_stub.call_rpc_count + listen_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::Firestore::V1::ListenRequest, r + assert_equal "hello world", r["database"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::Target), r["add_target"] + assert_equal :add_target, r.target_change + assert_equal({}, r["labels"].to_h) + end + end + end + end + + def test_list_collection_ids + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::V1::ListCollectionIdsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + read_time = {} + + list_collection_ids_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_collection_ids, name + assert_kind_of ::Google::Cloud::Firestore::V1::ListCollectionIdsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] + assert_equal :read_time, request.consistency_selector + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_collection_ids_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_collection_ids({ parent: parent, page_size: page_size, page_token: page_token, read_time: read_time }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_collection_ids parent: parent, page_size: page_size, page_token: page_token, read_time: read_time do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_collection_ids ::Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new(parent: parent, page_size: page_size, page_token: page_token, read_time: read_time) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_collection_ids({ parent: parent, page_size: page_size, page_token: page_token, read_time: read_time }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_collection_ids(::Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new(parent: parent, page_size: page_size, page_token: page_token, read_time: read_time), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_collection_ids_client_stub.call_rpc_count + end + end + + def test_batch_write + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::V1::BatchWriteResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + database = "hello world" + writes = [{}] + labels = {} + + batch_write_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_write, name + assert_kind_of ::Google::Cloud::Firestore::V1::BatchWriteRequest, request + assert_equal "hello world", request["database"] + assert_kind_of ::Google::Cloud::Firestore::V1::Write, request["writes"].first + assert_equal({}, request["labels"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_write_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_write({ database: database, writes: writes, labels: labels }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_write database: database, writes: writes, labels: labels do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_write ::Google::Cloud::Firestore::V1::BatchWriteRequest.new(database: database, writes: writes, labels: labels) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_write({ database: database, writes: writes, labels: labels }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_write(::Google::Cloud::Firestore::V1::BatchWriteRequest.new(database: database, writes: writes, labels: labels), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_write_client_stub.call_rpc_count + end + end + + def test_create_document + # Create GRPC objects. + grpc_response = ::Google::Cloud::Firestore::V1::Document.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" + collection_id = "hello world" + document_id = "hello world" + document = {} + mask = {} + + create_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_document, name + assert_kind_of ::Google::Cloud::Firestore::V1::CreateDocumentRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["collection_id"] + assert_equal "hello world", request["document_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::Document), request["document"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::DocumentMask), request["mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_document_client_stub do + # Create client + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_document({ parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_document parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_document ::Google::Cloud::Firestore::V1::CreateDocumentRequest.new(parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_document({ parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_document(::Google::Cloud::Firestore::V1::CreateDocumentRequest.new(parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_document_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::V1::Firestore::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::V1::Firestore::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Firestore::V1::Firestore::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-firestore-v1/test/helper.rb b/owl-bot-staging/google-cloud-firestore-v1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-firestore-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From b251e2ebab3ad00e63562202379c7eea54673da6 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 3 Mar 2026 00:02:37 +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 --- .../cloud/firestore/v1/firestore/client.rb | 10 +- .../firestore/v1/firestore/rest/client.rb | 10 +- .../lib/google/firestore/v1/document_pb.rb | 2 +- .../google/firestore/v1/document.rb | 37 +- .../google-cloud-firestore-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-firestore-v1/.rubocop.yml | 33 - .../google-cloud-firestore-v1/.toys.rb | 28 - .../google-cloud-firestore-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-firestore-v1/CHANGELOG.md | 2 - .../google-cloud-firestore-v1/Gemfile | 11 - .../google-cloud-firestore-v1/LICENSE.md | 201 -- .../google-cloud-firestore-v1/README.md | 154 -- .../google-cloud-firestore-v1/Rakefile | 169 -- .../gapic_metadata.json | 103 - .../google-cloud-firestore-v1.gemspec | 29 - .../lib/google-cloud-firestore-v1.rb | 21 - .../lib/google/cloud/firestore/v1.rb | 45 - .../google/cloud/firestore/v1/firestore.rb | 61 - .../cloud/firestore/v1/firestore/client.rb | 2413 ----------------- .../firestore/v1/firestore/credentials.rb | 52 - .../cloud/firestore/v1/firestore/rest.rb | 58 - .../firestore/v1/firestore/rest/client.rb | 2079 -------------- .../v1/firestore/rest/service_stub.rb | 1026 ------- .../lib/google/cloud/firestore/v1/rest.rb | 37 - .../lib/google/cloud/firestore/v1/version.rb | 28 - .../firestore/v1/aggregation_result_pb.rb | 45 - .../google/firestore/v1/bloom_filter_pb.rb | 43 - .../lib/google/firestore/v1/common_pb.rb | 49 - .../lib/google/firestore/v1/document_pb.rb | 55 - .../google/firestore/v1/explain_stats_pb.rb | 45 - .../lib/google/firestore/v1/firestore_pb.rb | 103 - .../firestore/v1/firestore_services_pb.rb | 114 - .../lib/google/firestore/v1/pipeline_pb.rb | 46 - .../lib/google/firestore/v1/query_pb.rb | 68 - .../google/firestore/v1/query_profile_pb.rb | 51 - .../lib/google/firestore/v1/write_pb.rb | 59 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 ---- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 -- .../proto_docs/google/api/routing.rb | 459 ---- .../google/firestore/v1/aggregation_result.rb | 53 - .../google/firestore/v1/bloom_filter.rb | 79 - .../proto_docs/google/firestore/v1/common.rb | 101 - .../google/firestore/v1/document.rb | 326 --- .../google/firestore/v1/explain_stats.rb | 41 - .../google/firestore/v1/firestore.rb | 1110 -------- .../google/firestore/v1/pipeline.rb | 51 - .../proto_docs/google/firestore/v1/query.rb | 629 ----- .../google/firestore/v1/query_profile.rb | 98 - .../proto_docs/google/firestore/v1/write.rb | 317 --- .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/struct.rb | 108 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/protobuf/wrappers.rb | 121 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/latlng.rb | 38 - .../snippets/Gemfile | 32 - .../snippets/firestore/batch_get_documents.rb | 50 - .../snippets/firestore/batch_write.rb | 47 - .../snippets/firestore/begin_transaction.rb | 47 - .../snippets/firestore/commit.rb | 47 - .../snippets/firestore/create_document.rb | 47 - .../snippets/firestore/delete_document.rb | 47 - .../snippets/firestore/execute_pipeline.rb | 50 - .../snippets/firestore/get_document.rb | 47 - .../snippets/firestore/list_collection_ids.rb | 47 - .../snippets/firestore/list_documents.rb | 51 - .../snippets/firestore/listen.rb | 56 - .../snippets/firestore/partition_query.rb | 51 - .../snippets/firestore/rollback.rb | 47 - .../firestore/run_aggregation_query.rb | 50 - .../snippets/firestore/run_query.rb | 50 - .../snippets/firestore/update_document.rb | 47 - .../snippets/firestore/write.rb | 56 - .../snippet_metadata_google.firestore.v1.json | 695 ----- .../cloud/firestore/v1/firestore_rest_test.rb | 951 ------- .../cloud/firestore/v1/firestore_test.rb | 1329 --------- .../google-cloud-firestore-v1/test/helper.rb | 25 - 84 files changed, 34 insertions(+), 16139 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/google-cloud-firestore-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google-cloud-firestore-v1.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/aggregation_result_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/bloom_filter_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/common_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/document_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/explain_stats_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/firestore_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/firestore_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/pipeline_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/query_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/query_profile_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/write_pb.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/routing.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/aggregation_result.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/bloom_filter.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/common.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/document.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/explain_stats.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/firestore.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/pipeline.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query_profile.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/write.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/type/latlng.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/batch_get_documents.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/batch_write.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/begin_transaction.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/commit.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/create_document.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/delete_document.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/execute_pipeline.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/get_document.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_collection_ids.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_documents.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/listen.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/partition_query.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/rollback.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_aggregation_query.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_query.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/update_document.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/write.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/snippets/snippet_metadata_google.firestore.v1.json delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_test.rb delete mode 100644 owl-bot-staging/google-cloud-firestore-v1/test/helper.rb diff --git a/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb b/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb index 348ca1416bc1..9e45763d3690 100644 --- a/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb +++ b/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb @@ -98,7 +98,7 @@ def self.configure default_config.rpcs.batch_get_documents.timeout = 300.0 default_config.rpcs.batch_get_documents.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] } default_config.rpcs.begin_transaction.timeout = 60.0 @@ -118,22 +118,22 @@ def self.configure default_config.rpcs.run_query.timeout = 300.0 default_config.rpcs.run_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] } default_config.rpcs.execute_pipeline.timeout = 300.0 default_config.rpcs.execute_pipeline.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] } default_config.rpcs.run_aggregation_query.timeout = 300.0 default_config.rpcs.run_aggregation_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] } default_config.rpcs.partition_query.timeout = 300.0 default_config.rpcs.partition_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] } default_config.rpcs.write.timeout = 86_400.0 diff --git a/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb b/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb index c143d420b998..44b394a0e6d3 100644 --- a/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb +++ b/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb @@ -100,7 +100,7 @@ def self.configure default_config.rpcs.batch_get_documents.timeout = 300.0 default_config.rpcs.batch_get_documents.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] } default_config.rpcs.begin_transaction.timeout = 60.0 @@ -120,22 +120,22 @@ def self.configure default_config.rpcs.run_query.timeout = 300.0 default_config.rpcs.run_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] } default_config.rpcs.execute_pipeline.timeout = 300.0 default_config.rpcs.execute_pipeline.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] } default_config.rpcs.run_aggregation_query.timeout = 300.0 default_config.rpcs.run_aggregation_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] } default_config.rpcs.partition_query.timeout = 300.0 default_config.rpcs.partition_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] } default_config.rpcs.list_collection_ids.timeout = 60.0 diff --git a/google-cloud-firestore-v1/lib/google/firestore/v1/document_pb.rb b/google-cloud-firestore-v1/lib/google/firestore/v1/document_pb.rb index b8d6b31b5d00..8cf9b80c1e28 100644 --- a/google-cloud-firestore-v1/lib/google/firestore/v1/document_pb.rb +++ b/google-cloud-firestore-v1/lib/google/firestore/v1/document_pb.rb @@ -10,7 +10,7 @@ require 'google/type/latlng_pb' -descriptor_data = "\n\"google/firestore/v1/document.proto\x12\x13google.firestore.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x18google/type/latlng.proto\"\x80\x02\n\x08\x44ocument\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x39\n\x06\x66ields\x18\x02 \x03(\x0b\x32).google.firestore.v1.Document.FieldsEntry\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aI\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\"\xc1\x04\n\x05Value\x12\x30\n\nnull_value\x18\x0b \x01(\x0e\x32\x1a.google.protobuf.NullValueH\x00\x12\x17\n\rboolean_value\x18\x01 \x01(\x08H\x00\x12\x17\n\rinteger_value\x18\x02 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x03 \x01(\x01H\x00\x12\x35\n\x0ftimestamp_value\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x16\n\x0cstring_value\x18\x11 \x01(\tH\x00\x12\x15\n\x0b\x62ytes_value\x18\x12 \x01(\x0cH\x00\x12\x19\n\x0freference_value\x18\x05 \x01(\tH\x00\x12.\n\x0fgeo_point_value\x18\x08 \x01(\x0b\x32\x13.google.type.LatLngH\x00\x12\x36\n\x0b\x61rray_value\x18\t \x01(\x0b\x32\x1f.google.firestore.v1.ArrayValueH\x00\x12\x32\n\tmap_value\x18\x06 \x01(\x0b\x32\x1d.google.firestore.v1.MapValueH\x00\x12\x1f\n\x15\x66ield_reference_value\x18\x13 \x01(\tH\x00\x12\x37\n\x0e\x66unction_value\x18\x14 \x01(\x0b\x32\x1d.google.firestore.v1.FunctionH\x00\x12\x37\n\x0epipeline_value\x18\x15 \x01(\x0b\x32\x1d.google.firestore.v1.PipelineH\x00\x42\x0c\n\nvalue_type\"8\n\nArrayValue\x12*\n\x06values\x18\x01 \x03(\x0b\x32\x1a.google.firestore.v1.Value\"\x90\x01\n\x08MapValue\x12\x39\n\x06\x66ields\x18\x01 \x03(\x0b\x32).google.firestore.v1.MapValue.FieldsEntry\x1aI\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\"\xda\x01\n\x08\x46unction\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12-\n\x04\x61rgs\x18\x02 \x03(\x0b\x32\x1a.google.firestore.v1.ValueB\x03\xe0\x41\x01\x12@\n\x07options\x18\x03 \x03(\x0b\x32*.google.firestore.v1.Function.OptionsEntryB\x03\xe0\x41\x01\x1aJ\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\"\xa4\x02\n\x08Pipeline\x12\x38\n\x06stages\x18\x01 \x03(\x0b\x32#.google.firestore.v1.Pipeline.StageB\x03\xe0\x41\x02\x1a\xdd\x01\n\x05Stage\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12-\n\x04\x61rgs\x18\x02 \x03(\x0b\x32\x1a.google.firestore.v1.ValueB\x03\xe0\x41\x01\x12\x46\n\x07options\x18\x03 \x03(\x0b\x32\x30.google.firestore.v1.Pipeline.Stage.OptionsEntryB\x03\xe0\x41\x01\x1aJ\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\x42\xc5\x01\n\x17\x63om.google.firestore.v1B\rDocumentProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::V1b\x06proto3" +descriptor_data = "\n\"google/firestore/v1/document.proto\x12\x13google.firestore.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x18google/type/latlng.proto\"\x80\x02\n\x08\x44ocument\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x39\n\x06\x66ields\x18\x02 \x03(\x0b\x32).google.firestore.v1.Document.FieldsEntry\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aI\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\"\xe5\x04\n\x05Value\x12\x30\n\nnull_value\x18\x0b \x01(\x0e\x32\x1a.google.protobuf.NullValueH\x00\x12\x17\n\rboolean_value\x18\x01 \x01(\x08H\x00\x12\x17\n\rinteger_value\x18\x02 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x03 \x01(\x01H\x00\x12\x35\n\x0ftimestamp_value\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x16\n\x0cstring_value\x18\x11 \x01(\tH\x00\x12\x15\n\x0b\x62ytes_value\x18\x12 \x01(\x0cH\x00\x12\x19\n\x0freference_value\x18\x05 \x01(\tH\x00\x12.\n\x0fgeo_point_value\x18\x08 \x01(\x0b\x32\x13.google.type.LatLngH\x00\x12\x36\n\x0b\x61rray_value\x18\t \x01(\x0b\x32\x1f.google.firestore.v1.ArrayValueH\x00\x12\x32\n\tmap_value\x18\x06 \x01(\x0b\x32\x1d.google.firestore.v1.MapValueH\x00\x12\x1f\n\x15\x66ield_reference_value\x18\x13 \x01(\tH\x00\x12\"\n\x18variable_reference_value\x18\x16 \x01(\tH\x00\x12\x37\n\x0e\x66unction_value\x18\x14 \x01(\x0b\x32\x1d.google.firestore.v1.FunctionH\x00\x12\x37\n\x0epipeline_value\x18\x15 \x01(\x0b\x32\x1d.google.firestore.v1.PipelineH\x00\x42\x0c\n\nvalue_type\"8\n\nArrayValue\x12*\n\x06values\x18\x01 \x03(\x0b\x32\x1a.google.firestore.v1.Value\"\x90\x01\n\x08MapValue\x12\x39\n\x06\x66ields\x18\x01 \x03(\x0b\x32).google.firestore.v1.MapValue.FieldsEntry\x1aI\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\"\xda\x01\n\x08\x46unction\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12-\n\x04\x61rgs\x18\x02 \x03(\x0b\x32\x1a.google.firestore.v1.ValueB\x03\xe0\x41\x01\x12@\n\x07options\x18\x03 \x03(\x0b\x32*.google.firestore.v1.Function.OptionsEntryB\x03\xe0\x41\x01\x1aJ\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\"\xa4\x02\n\x08Pipeline\x12\x38\n\x06stages\x18\x01 \x03(\x0b\x32#.google.firestore.v1.Pipeline.StageB\x03\xe0\x41\x02\x1a\xdd\x01\n\x05Stage\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12-\n\x04\x61rgs\x18\x02 \x03(\x0b\x32\x1a.google.firestore.v1.ValueB\x03\xe0\x41\x01\x12\x46\n\x07options\x18\x03 \x03(\x0b\x32\x30.google.firestore.v1.Pipeline.Stage.OptionsEntryB\x03\xe0\x41\x01\x1aJ\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\x42\xc5\x01\n\x17\x63om.google.firestore.v1B\rDocumentProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool diff --git a/google-cloud-firestore-v1/proto_docs/google/firestore/v1/document.rb b/google-cloud-firestore-v1/proto_docs/google/firestore/v1/document.rb index 9ee4b7305cb0..b3ecd19cbab9 100644 --- a/google-cloud-firestore-v1/proto_docs/google/firestore/v1/document.rb +++ b/google-cloud-firestore-v1/proto_docs/google/firestore/v1/document.rb @@ -87,22 +87,22 @@ class FieldsEntry # @return [::Google::Protobuf::NullValue] # A null value. # - # Note: The following fields are mutually exclusive: `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] boolean_value # @return [::Boolean] # A boolean value. # - # Note: The following fields are mutually exclusive: `boolean_value`, `null_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `boolean_value`, `null_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] integer_value # @return [::Integer] # An integer value. # - # Note: The following fields are mutually exclusive: `integer_value`, `null_value`, `boolean_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `integer_value`, `null_value`, `boolean_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] double_value # @return [::Float] # A double value. # - # Note: The following fields are mutually exclusive: `double_value`, `null_value`, `boolean_value`, `integer_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `double_value`, `null_value`, `boolean_value`, `integer_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] timestamp_value # @return [::Google::Protobuf::Timestamp] # A timestamp value. @@ -110,7 +110,7 @@ class FieldsEntry # Precise only to microseconds. When stored, any additional precision is # rounded down. # - # Note: The following fields are mutually exclusive: `timestamp_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `timestamp_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] string_value # @return [::String] # A string value. @@ -119,7 +119,7 @@ class FieldsEntry # Only the first 1,500 bytes of the UTF-8 representation are considered by # queries. # - # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] bytes_value # @return [::String] # A bytes value. @@ -127,18 +127,18 @@ class FieldsEntry # Must not exceed 1 MiB - 89 bytes. # Only the first 1,500 bytes are considered by queries. # - # Note: The following fields are mutually exclusive: `bytes_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `bytes_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] reference_value # @return [::String] # A reference to a document. For example: # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. # - # Note: The following fields are mutually exclusive: `reference_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `reference_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] geo_point_value # @return [::Google::Type::LatLng] # A geo point value representing a point on the surface of Earth. # - # Note: The following fields are mutually exclusive: `geo_point_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `array_value`, `map_value`, `field_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `geo_point_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] array_value # @return [::Google::Cloud::Firestore::V1::ArrayValue] # An array value. @@ -146,12 +146,12 @@ class FieldsEntry # Cannot directly contain another array value, though can contain a # map which contains another array. # - # Note: The following fields are mutually exclusive: `array_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `map_value`, `field_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `array_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] map_value # @return [::Google::Cloud::Firestore::V1::MapValue] # A map value. # - # Note: The following fields are mutually exclusive: `map_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `field_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `map_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] field_reference_value # @return [::String] # Value which references a field. @@ -165,7 +165,16 @@ class FieldsEntry # # * Not allowed to be used when writing documents. # - # Note: The following fields are mutually exclusive: `field_reference_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `field_reference_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] variable_reference_value + # @return [::String] + # Pointer to a variable defined elsewhere in a pipeline. + # + # Unlike `field_reference_value` which references a field within a + # document, this refers to a variable, defined in a separate namespace than + # the fields of a document. + # + # Note: The following fields are mutually exclusive: `variable_reference_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] function_value # @return [::Google::Cloud::Firestore::V1::Function] # A value that represents an unevaluated expression. @@ -174,7 +183,7 @@ class FieldsEntry # # * Not allowed to be used when writing documents. # - # Note: The following fields are mutually exclusive: `function_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `function_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] pipeline_value # @return [::Google::Cloud::Firestore::V1::Pipeline] # A value that represents an unevaluated pipeline. @@ -183,7 +192,7 @@ class FieldsEntry # # * Not allowed to be used when writing documents. # - # Note: The following fields are mutually exclusive: `pipeline_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `function_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `pipeline_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. class Value include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/owl-bot-staging/google-cloud-firestore-v1/.gitignore b/owl-bot-staging/google-cloud-firestore-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-firestore-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-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-firestore-v1/.repo-metadata.json deleted file mode 100644 index 195e6cac6d41..000000000000 --- a/owl-bot-staging/google-cloud-firestore-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-v1/latest", - "distribution_name": "google-cloud-firestore-v1", - "is_cloud": true, - "language": "ruby", - "name": "firestore", - "name_pretty": "Cloud Firestore 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-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-firestore 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-v1/.rubocop.yml b/owl-bot-staging/google-cloud-firestore-v1/.rubocop.yml deleted file mode 100644 index b39192458484..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-firestore-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-v1.rb" diff --git a/owl-bot-staging/google-cloud-firestore-v1/.toys.rb b/owl-bot-staging/google-cloud-firestore-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/.yardopts b/owl-bot-staging/google-cloud-firestore-v1/.yardopts deleted file mode 100644 index 3ca29a5a2e96..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Firestore 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-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-firestore-v1/AUTHENTICATION.md deleted file mode 100644 index 928670fe30c0..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-firestore-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-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/v1" - -client = ::Google::Cloud::Firestore::V1::Firestore::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/v1" - -::Google::Cloud::Firestore::V1::Firestore::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Firestore::V1::Firestore::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-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/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Firestore::V1::Firestore::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-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-firestore-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-firestore-v1/Gemfile b/owl-bot-staging/google-cloud-firestore-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-firestore-v1/LICENSE.md b/owl-bot-staging/google-cloud-firestore-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-firestore-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-v1/README.md b/owl-bot-staging/google-cloud-firestore-v1/README.md deleted file mode 100644 index f635e3ad0443..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Firestore 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 V1 API. Most users should consider using -the main client gem, -[google-cloud-firestore](https://rubygems.org/gems/google-cloud-firestore). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-firestore-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/v1" - -client = ::Google::Cloud::Firestore::V1::Firestore::Client.new -request = ::Google::Cloud::Firestore::V1::GetDocumentRequest.new # (request fields as keyword arguments...) -response = client.get_document request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/firestore) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/firestore/v1" -require "logger" - -client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.logger = Logger.new "my-app.log" -end -``` - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-firestore`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-firestore-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`. -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-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-v1/Rakefile b/owl-bot-staging/google-cloud-firestore-v1/Rakefile deleted file mode 100644 index 070c05371228..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-firestore-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/v1/firestore/credentials" - ::Google::Cloud::Firestore::V1::Firestore::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-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-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-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-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-firestore-v1" - header "google-cloud-firestore-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-firestore-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-firestore-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-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-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-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-firestore-v1/gapic_metadata.json deleted file mode 100644 index 46f4f6d27b0b..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/gapic_metadata.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.firestore.v1", - "libraryPackage": "::Google::Cloud::Firestore::V1", - "services": { - "Firestore": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Firestore::V1::Firestore::Client", - "rpcs": { - "GetDocument": { - "methods": [ - "get_document" - ] - }, - "ListDocuments": { - "methods": [ - "list_documents" - ] - }, - "UpdateDocument": { - "methods": [ - "update_document" - ] - }, - "DeleteDocument": { - "methods": [ - "delete_document" - ] - }, - "BatchGetDocuments": { - "methods": [ - "batch_get_documents" - ] - }, - "BeginTransaction": { - "methods": [ - "begin_transaction" - ] - }, - "Commit": { - "methods": [ - "commit" - ] - }, - "Rollback": { - "methods": [ - "rollback" - ] - }, - "RunQuery": { - "methods": [ - "run_query" - ] - }, - "ExecutePipeline": { - "methods": [ - "execute_pipeline" - ] - }, - "RunAggregationQuery": { - "methods": [ - "run_aggregation_query" - ] - }, - "PartitionQuery": { - "methods": [ - "partition_query" - ] - }, - "Write": { - "methods": [ - "write" - ] - }, - "Listen": { - "methods": [ - "listen" - ] - }, - "ListCollectionIds": { - "methods": [ - "list_collection_ids" - ] - }, - "BatchWrite": { - "methods": [ - "batch_write" - ] - }, - "CreateDocument": { - "methods": [ - "create_document" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-firestore-v1/google-cloud-firestore-v1.gemspec b/owl-bot-staging/google-cloud-firestore-v1/google-cloud-firestore-v1.gemspec deleted file mode 100644 index 9821a35b2173..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/google-cloud-firestore-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/firestore/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-firestore-v1" - gem.version = Google::Cloud::Firestore::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-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-firestore 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 = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google-cloud-firestore-v1.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google-cloud-firestore-v1.rb deleted file mode 100644 index a06d65d7c71a..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google-cloud-firestore-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/firestore/v1" diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1.rb deleted file mode 100644 index b062b442952c..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/firestore/v1/firestore" -require "google/cloud/firestore/v1/version" - -module Google - module Cloud - module Firestore - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/firestore/v1" - # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/firestore/v1" - # client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/firestore/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore.rb deleted file mode 100644 index 839d1e4340f2..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/firestore/v1/version" - -require "google/cloud/firestore/v1/firestore/credentials" -require "google/cloud/firestore/v1/firestore/client" -require "google/cloud/firestore/v1/firestore/rest" - -module Google - module Cloud - module Firestore - module V1 - ## - # The Cloud Firestore service. - # - # Cloud Firestore is a fast, fully managed, serverless, cloud-native NoSQL - # document database that simplifies storing, syncing, and querying data for - # your mobile, web, and IoT apps at global scale. Its client libraries provide - # live synchronization and offline support, while its security features and - # integrations with Firebase and Google Cloud Platform accelerate building - # truly serverless apps. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/firestore/v1/firestore" - # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/firestore/v1/firestore/rest" - # client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - module Firestore - end - end - end - end -end - -helper_path = ::File.join __dir__, "firestore", "helpers.rb" -require "google/cloud/firestore/v1/firestore/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb deleted file mode 100644 index af67bc0641db..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb +++ /dev/null @@ -1,2413 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/firestore/v1/firestore_pb" -require "google/cloud/location" - -module Google - module Cloud - module Firestore - module V1 - module Firestore - ## - # Client for the Firestore service. - # - # The Cloud Firestore service. - # - # Cloud Firestore is a fast, fully managed, serverless, cloud-native NoSQL - # document database that simplifies storing, syncing, and querying data for - # your mobile, web, and IoT apps at global scale. Its client libraries provide - # live synchronization and offline support, while its security features and - # integrations with Firebase and Google Cloud Platform accelerate building - # truly serverless apps. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "firestore.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :firestore_stub - - ## - # Configure the Firestore Client class. - # - # See {::Google::Cloud::Firestore::V1::Firestore::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Firestore clients - # ::Google::Cloud::Firestore::V1::Firestore::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", "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.get_document.timeout = 60.0 - default_config.rpcs.get_document.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] - } - - default_config.rpcs.list_documents.timeout = 60.0 - default_config.rpcs.list_documents.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] - } - - default_config.rpcs.update_document.timeout = 60.0 - default_config.rpcs.update_document.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14] - } - - default_config.rpcs.delete_document.timeout = 60.0 - default_config.rpcs.delete_document.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] - } - - default_config.rpcs.batch_get_documents.timeout = 300.0 - default_config.rpcs.batch_get_documents.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.begin_transaction.timeout = 60.0 - default_config.rpcs.begin_transaction.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] - } - - default_config.rpcs.commit.timeout = 60.0 - default_config.rpcs.commit.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14] - } - - default_config.rpcs.rollback.timeout = 60.0 - default_config.rpcs.rollback.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] - } - - default_config.rpcs.run_query.timeout = 300.0 - default_config.rpcs.run_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.execute_pipeline.timeout = 300.0 - default_config.rpcs.execute_pipeline.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.run_aggregation_query.timeout = 300.0 - default_config.rpcs.run_aggregation_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.partition_query.timeout = 300.0 - default_config.rpcs.partition_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.write.timeout = 86_400.0 - - default_config.rpcs.listen.timeout = 86_400.0 - default_config.rpcs.listen.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] - } - - default_config.rpcs.list_collection_ids.timeout = 60.0 - default_config.rpcs.list_collection_ids.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] - } - - default_config.rpcs.batch_write.timeout = 60.0 - default_config.rpcs.batch_write.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 10] - } - - default_config.rpcs.create_document.timeout = 60.0 - default_config.rpcs.create_document.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Firestore 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::V1::Firestore::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_stub.universe_domain - end - - ## - # Create a new Firestore client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Firestore 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/v1/firestore_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 - - @firestore_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Firestore::V1::Firestore::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @firestore_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @firestore_stub.endpoint - config.universe_domain = @firestore_stub.universe_domain - config.logger = @firestore_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @firestore_stub.logger - end - - # Service calls - - ## - # Gets a single document. - # - # @overload get_document(request, options = nil) - # Pass arguments to `get_document` via a request object, either of type - # {::Google::Cloud::Firestore::V1::GetDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::GetDocumentRequest, ::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_document(name: nil, mask: nil, transaction: nil, read_time: nil) - # Pass arguments to `get_document` 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 resource name of the Document to get. In the format: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] - # The fields to return. If not set, returns all fields. - # - # If the document has a field that is not present in this mask, that field - # will not be returned in the response. - # @param transaction [::String] - # Reads the document in a transaction. - # - # Note: The following parameters are mutually exclusive: `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Reads the version of the document at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following parameters are mutually exclusive: `read_time`, `transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::V1::Document] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::V1::Document] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::GetDocumentRequest.new - # - # # Call the get_document method. - # result = client.get_document request - # - # # The returned object is of type Google::Cloud::Firestore::V1::Document. - # p result - # - def get_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::GetDocumentRequest - - # 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_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :get_document, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists documents. - # - # @overload list_documents(request, options = nil) - # Pass arguments to `list_documents` via a request object, either of type - # {::Google::Cloud::Firestore::V1::ListDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::ListDocumentsRequest, ::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_documents(parent: nil, collection_id: nil, page_size: nil, page_token: nil, order_by: nil, mask: nil, transaction: nil, read_time: nil, show_missing: nil) - # Pass arguments to `list_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 parent [::String] - # Required. The parent resource name. In the format: - # `projects/{project_id}/databases/{database_id}/documents` or - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # - # For example: - # `projects/my-project/databases/my-database/documents` or - # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - # @param collection_id [::String] - # Optional. The collection ID, relative to `parent`, to list. - # - # For example: `chatrooms` or `messages`. - # - # This is optional, and when not provided, Firestore will list documents - # from all collections under the provided `parent`. - # @param page_size [::Integer] - # Optional. The maximum number of documents to return in a single response. - # - # Firestore may return fewer than this value. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListDocuments` response. - # - # Provide this to retrieve the subsequent page. When paginating, all other - # parameters (with the exception of `page_size`) must match the values set - # in the request that generated the page token. - # @param order_by [::String] - # Optional. The optional ordering of the documents to return. - # - # For example: `priority desc, __name__ desc`. - # - # This mirrors the {::Google::Cloud::Firestore::V1::StructuredQuery#order_by `ORDER BY`} - # used in Firestore queries but in a string representation. When absent, - # documents are ordered based on `__name__ ASC`. - # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] - # Optional. The fields to return. If not set, returns all fields. - # - # If a document has a field that is not present in this mask, that field - # will not be returned in the response. - # @param transaction [::String] - # Perform the read as part of an already active transaction. - # - # Note: The following parameters are mutually exclusive: `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Perform the read at the provided time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following parameters are mutually exclusive: `read_time`, `transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param show_missing [::Boolean] - # If the list should show missing documents. - # - # A document is missing if it does not exist, but there are sub-documents - # nested underneath it. When true, such missing documents will be returned - # with a key but will not have fields, - # {::Google::Cloud::Firestore::V1::Document#create_time `create_time`}, or - # {::Google::Cloud::Firestore::V1::Document#update_time `update_time`} set. - # - # Requests with `show_missing` may not specify `where` or `order_by`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Document>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Document>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::ListDocumentsRequest.new - # - # # Call the list_documents method. - # result = client.list_documents 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::V1::Document. - # p item - # end - # - def list_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::ListDocumentsRequest - - # 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_documents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - if request.collection_id - header_params["collection_id"] = request.collection_id - 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_documents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :list_documents, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @firestore_stub, :list_documents, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates or inserts a document. - # - # @overload update_document(request, options = nil) - # Pass arguments to `update_document` via a request object, either of type - # {::Google::Cloud::Firestore::V1::UpdateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::UpdateDocumentRequest, ::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_document(document: nil, update_mask: nil, mask: nil, current_document: nil) - # Pass arguments to `update_document` 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 document [::Google::Cloud::Firestore::V1::Document, ::Hash] - # Required. The updated document. - # Creates the document if it does not already exist. - # @param update_mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] - # The fields to update. - # None of the field paths in the mask may contain a reserved name. - # - # If the document exists on the server and has fields not referenced in the - # mask, they are left unchanged. - # Fields referenced in the mask, but not present in the input document, are - # deleted from the document on the server. - # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] - # The fields to return. If not set, returns all fields. - # - # If the document has a field that is not present in this mask, that field - # will not be returned in the response. - # @param current_document [::Google::Cloud::Firestore::V1::Precondition, ::Hash] - # An optional precondition on the document. - # The request will fail if this is set and not met by the target document. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::V1::Document] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::V1::Document] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::UpdateDocumentRequest.new - # - # # Call the update_document method. - # result = client.update_document request - # - # # The returned object is of type Google::Cloud::Firestore::V1::Document. - # p result - # - def update_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::UpdateDocumentRequest - - # 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_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.document&.name - header_params["document.name"] = request.document.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_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :update_document, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a document. - # - # @overload delete_document(request, options = nil) - # Pass arguments to `delete_document` via a request object, either of type - # {::Google::Cloud::Firestore::V1::DeleteDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::DeleteDocumentRequest, ::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_document(name: nil, current_document: nil) - # Pass arguments to `delete_document` 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 resource name of the Document to delete. In the format: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # @param current_document [::Google::Cloud::Firestore::V1::Precondition, ::Hash] - # An optional precondition on the document. - # The request will fail if this is set and not met by the target document. - # - # @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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::DeleteDocumentRequest.new - # - # # Call the delete_document method. - # result = client.delete_document request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::DeleteDocumentRequest - - # 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_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :delete_document, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets multiple documents. - # - # Documents returned by this method are not guaranteed to be returned in the - # same order that they were requested. - # - # @overload batch_get_documents(request, options = nil) - # Pass arguments to `batch_get_documents` via a request object, either of type - # {::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_get_documents(database: nil, documents: nil, mask: nil, transaction: nil, new_transaction: nil, read_time: nil) - # Pass arguments to `batch_get_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 database [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @param documents [::Array<::String>] - # The names of the documents to retrieve. In the format: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # The request will fail if any of the document is not a child resource of the - # given `database`. Duplicate names will be elided. - # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] - # The fields to return. If not set, returns all fields. - # - # If a document has a field that is not present in this mask, that field will - # not be returned in the response. - # @param transaction [::String] - # Reads documents in a transaction. - # - # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] - # Starts a new transaction and reads the documents. - # Defaults to a read-only transaction. - # The new transaction ID will be returned as the first response in the - # stream. - # - # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Reads documents as they were at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new - # - # # Call the batch_get_documents method to start streaming. - # output = client.batch_get_documents request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse - # output.each do |current_response| - # p current_response - # end - # - def batch_get_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_get_documents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - header_params["database"] = request.database - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_get_documents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_get_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :batch_get_documents, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts a new transaction. - # - # @overload begin_transaction(request, options = nil) - # Pass arguments to `begin_transaction` via a request object, either of type - # {::Google::Cloud::Firestore::V1::BeginTransactionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::BeginTransactionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload begin_transaction(database: nil, options: nil) - # Pass arguments to `begin_transaction` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @param options [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] - # The options for the transaction. - # Defaults to a read-write transaction. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::V1::BeginTransactionResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::V1::BeginTransactionResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::BeginTransactionRequest.new - # - # # Call the begin_transaction method. - # result = client.begin_transaction request - # - # # The returned object is of type Google::Cloud::Firestore::V1::BeginTransactionResponse. - # p result - # - def begin_transaction request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::BeginTransactionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.begin_transaction.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - header_params["database"] = request.database - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.begin_transaction.timeout, - metadata: metadata, - retry_policy: @config.rpcs.begin_transaction.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :begin_transaction, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Commits a transaction, while optionally updating documents. - # - # @overload commit(request, options = nil) - # Pass arguments to `commit` via a request object, either of type - # {::Google::Cloud::Firestore::V1::CommitRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::CommitRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload commit(database: nil, writes: nil, transaction: nil) - # Pass arguments to `commit` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @param writes [::Array<::Google::Cloud::Firestore::V1::Write, ::Hash>] - # The writes to apply. - # - # Always executed atomically and in order. - # @param transaction [::String] - # If set, applies all writes in this transaction, and commits it. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::V1::CommitResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::V1::CommitResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::CommitRequest.new - # - # # Call the commit method. - # result = client.commit request - # - # # The returned object is of type Google::Cloud::Firestore::V1::CommitResponse. - # p result - # - def commit request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::CommitRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.commit.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - header_params["database"] = request.database - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.commit.timeout, - metadata: metadata, - retry_policy: @config.rpcs.commit.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :commit, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Rolls back a transaction. - # - # @overload rollback(request, options = nil) - # Pass arguments to `rollback` via a request object, either of type - # {::Google::Cloud::Firestore::V1::RollbackRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::RollbackRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload rollback(database: nil, transaction: nil) - # Pass arguments to `rollback` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @param transaction [::String] - # Required. The transaction to roll back. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::RollbackRequest.new - # - # # Call the rollback method. - # result = client.rollback request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def rollback request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::RollbackRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.rollback.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - header_params["database"] = request.database - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.rollback.timeout, - metadata: metadata, - retry_policy: @config.rpcs.rollback.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :rollback, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Runs a query. - # - # @overload run_query(request, options = nil) - # Pass arguments to `run_query` via a request object, either of type - # {::Google::Cloud::Firestore::V1::RunQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::RunQueryRequest, ::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 run_query(parent: nil, structured_query: nil, transaction: nil, new_transaction: nil, read_time: nil, explain_options: nil) - # Pass arguments to `run_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name. In the format: - # `projects/{project_id}/databases/{database_id}/documents` or - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # For example: - # `projects/my-project/databases/my-database/documents` or - # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - # @param structured_query [::Google::Cloud::Firestore::V1::StructuredQuery, ::Hash] - # A structured query. - # @param transaction [::String] - # Run the query within an already active transaction. - # - # The value here is the opaque transaction ID to execute the query in. - # - # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] - # Starts a new transaction and reads the documents. - # Defaults to a read-only transaction. - # The new transaction ID will be returned as the first response in the - # stream. - # - # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Reads documents as they were at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param explain_options [::Google::Cloud::Firestore::V1::ExplainOptions, ::Hash] - # Optional. Explain options for the query. If set, additional query - # statistics will be returned. If not, only query results will be returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Firestore::V1::RunQueryResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Firestore::V1::RunQueryResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::RunQueryRequest.new - # - # # Call the run_query method to start streaming. - # output = client.run_query request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Firestore::V1::RunQueryResponse - # output.each do |current_response| - # p current_response - # end - # - def run_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::RunQueryRequest - - # 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.run_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.run_query.timeout, - metadata: metadata, - retry_policy: @config.rpcs.run_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :run_query, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Executes a pipeline query. - # - # @overload execute_pipeline(request, options = nil) - # Pass arguments to `execute_pipeline` via a request object, either of type - # {::Google::Cloud::Firestore::V1::ExecutePipelineRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::ExecutePipelineRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload execute_pipeline(database: nil, structured_pipeline: nil, transaction: nil, new_transaction: nil, read_time: nil) - # Pass arguments to `execute_pipeline` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. Database identifier, in the form - # `projects/{project}/databases/{database}`. - # @param structured_pipeline [::Google::Cloud::Firestore::V1::StructuredPipeline, ::Hash] - # A pipelined operation. - # @param transaction [::String] - # Run the query within an already active transaction. - # - # The value here is the opaque transaction ID to execute the query in. - # - # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] - # Execute the pipeline in a new transaction. - # - # The identifier of the newly created transaction will be returned in the - # first response on the stream. This defaults to a read-only transaction. - # - # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Execute the pipeline in a snapshot transaction at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Firestore::V1::ExecutePipelineResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Firestore::V1::ExecutePipelineResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::ExecutePipelineRequest.new - # - # # Call the execute_pipeline method to start streaming. - # output = client.execute_pipeline request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Firestore::V1::ExecutePipelineResponse - # output.each do |current_response| - # p current_response - # end - # - def execute_pipeline request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::ExecutePipelineRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.execute_pipeline.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - regex_match = %r{^projects/(?[^/]+)(?:/.*)?$}.match request.database - if regex_match - header_params["project_id"] = regex_match["project_id".to_s] - end - end - if request.database - regex_match = %r{^projects/[^/]+/databases/(?[^/]+)(?:/.*)?$}.match request.database - if regex_match - header_params["database_id"] = regex_match["database_id".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.execute_pipeline.timeout, - metadata: metadata, - retry_policy: @config.rpcs.execute_pipeline.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :execute_pipeline, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Runs an aggregation query. - # - # Rather than producing {::Google::Cloud::Firestore::V1::Document Document} results like - # {::Google::Cloud::Firestore::V1::Firestore::Client#run_query Firestore.RunQuery}, this API - # allows running an aggregation to produce a series of - # {::Google::Cloud::Firestore::V1::AggregationResult AggregationResult} server-side. - # - # High-Level Example: - # - # ``` - # -- Return the number of documents in table given a filter. - # SELECT COUNT(*) FROM ( SELECT * FROM k where a = true ); - # ``` - # - # @overload run_aggregation_query(request, options = nil) - # Pass arguments to `run_aggregation_query` via a request object, either of type - # {::Google::Cloud::Firestore::V1::RunAggregationQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::RunAggregationQueryRequest, ::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 run_aggregation_query(parent: nil, structured_aggregation_query: nil, transaction: nil, new_transaction: nil, read_time: nil, explain_options: nil) - # Pass arguments to `run_aggregation_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name. In the format: - # `projects/{project_id}/databases/{database_id}/documents` or - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # For example: - # `projects/my-project/databases/my-database/documents` or - # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - # @param structured_aggregation_query [::Google::Cloud::Firestore::V1::StructuredAggregationQuery, ::Hash] - # An aggregation query. - # @param transaction [::String] - # Run the aggregation within an already active transaction. - # - # The value here is the opaque transaction ID to execute the query in. - # - # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] - # Starts a new transaction as part of the query, defaulting to read-only. - # - # The new transaction ID will be returned as the first response in the - # stream. - # - # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Executes the query at the given timestamp. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param explain_options [::Google::Cloud::Firestore::V1::ExplainOptions, ::Hash] - # Optional. Explain options for the query. If set, additional query - # statistics will be returned. If not, only query results will be returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Firestore::V1::RunAggregationQueryResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Firestore::V1::RunAggregationQueryResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new - # - # # Call the run_aggregation_query method to start streaming. - # output = client.run_aggregation_query request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse - # output.each do |current_response| - # p current_response - # end - # - def run_aggregation_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::RunAggregationQueryRequest - - # 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.run_aggregation_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.run_aggregation_query.timeout, - metadata: metadata, - retry_policy: @config.rpcs.run_aggregation_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :run_aggregation_query, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Partitions a query by returning partition cursors that can be used to run - # the query in parallel. The returned partition cursors are split points that - # can be used by RunQuery as starting/end points for the query results. - # - # @overload partition_query(request, options = nil) - # Pass arguments to `partition_query` via a request object, either of type - # {::Google::Cloud::Firestore::V1::PartitionQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::PartitionQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload partition_query(parent: nil, structured_query: nil, partition_count: nil, page_token: nil, page_size: nil, read_time: nil) - # Pass arguments to `partition_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name. In the format: - # `projects/{project_id}/databases/{database_id}/documents`. - # Document resource names are not supported; only database resource names - # can be specified. - # @param structured_query [::Google::Cloud::Firestore::V1::StructuredQuery, ::Hash] - # A structured query. - # Query must specify collection with all descendants and be ordered by name - # ascending. Other filters, order bys, limits, offsets, and start/end - # cursors are not supported. - # @param partition_count [::Integer] - # The desired maximum number of partition points. - # The partitions may be returned across multiple pages of results. - # The number must be positive. The actual number of partitions - # returned may be fewer. - # - # For example, this may be set to one fewer than the number of parallel - # queries to be run, or in running a data pipeline job, one fewer than the - # number of workers or compute instances available. - # @param page_token [::String] - # The `next_page_token` value returned from a previous call to - # PartitionQuery that may be used to get an additional set of results. - # There are no ordering guarantees between sets of results. Thus, using - # multiple sets of results will require merging the different result sets. - # - # For example, two subsequent calls using a page_token may return: - # - # * cursor B, cursor M, cursor Q - # * cursor A, cursor U, cursor W - # - # To obtain a complete result set ordered with respect to the results of the - # query supplied to PartitionQuery, the results sets should be merged: - # cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W - # @param page_size [::Integer] - # The maximum number of partitions to return in this call, subject to - # `partition_count`. - # - # For example, if `partition_count` = 10 and `page_size` = 8, the first call - # to PartitionQuery will return up to 8 partitions and a `next_page_token` - # if more results exist. A second call to PartitionQuery will return up to - # 2 partitions, to complete the total of 10 specified in `partition_count`. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Reads documents as they were at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Cursor>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Cursor>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::PartitionQueryRequest.new - # - # # Call the partition_query method. - # result = client.partition_query 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::V1::Cursor. - # p item - # end - # - def partition_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::PartitionQueryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.partition_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.partition_query.timeout, - metadata: metadata, - retry_policy: @config.rpcs.partition_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :partition_query, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @firestore_stub, :partition_query, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Streams batches of document updates and deletes, in order. This method is - # only available via gRPC or WebChannel (not REST). - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Firestore::V1::WriteRequest, ::Hash>] - # An enumerable of {::Google::Cloud::Firestore::V1::WriteRequest} instances. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Firestore::V1::WriteResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Firestore::V1::WriteResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the write method to start streaming. - # output = client.write input - # - # # Send requests on the stream. For each request object, set fields by - # # passing keyword arguments. Be sure to close the stream when done. - # input << Google::Cloud::Firestore::V1::WriteRequest.new - # input << Google::Cloud::Firestore::V1::WriteRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Firestore::V1::WriteResponse - # output.each do |current_response| - # p current_response - # end - # - def write request, options = nil - unless request.is_a? ::Enumerable - raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum - request = request.to_enum - end - - request = request.lazy.map do |req| - ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Firestore::V1::WriteRequest - end - - # 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.write.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.write.timeout, - metadata: metadata, - retry_policy: @config.rpcs.write.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :write, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Listens to changes. This method is only available via gRPC or WebChannel - # (not REST). - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Firestore::V1::ListenRequest, ::Hash>] - # An enumerable of {::Google::Cloud::Firestore::V1::ListenRequest} instances. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::Firestore::V1::ListenResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Firestore::V1::ListenResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the listen method to start streaming. - # output = client.listen input - # - # # Send requests on the stream. For each request object, set fields by - # # passing keyword arguments. Be sure to close the stream when done. - # input << Google::Cloud::Firestore::V1::ListenRequest.new - # input << Google::Cloud::Firestore::V1::ListenRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Firestore::V1::ListenResponse - # output.each do |current_response| - # p current_response - # end - # - def listen request, options = nil - unless request.is_a? ::Enumerable - raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum - request = request.to_enum - end - - request = request.lazy.map do |req| - ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Firestore::V1::ListenRequest - end - - # 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.listen.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.listen.timeout, - metadata: metadata, - retry_policy: @config.rpcs.listen.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :listen, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the collection IDs underneath a document. - # - # @overload list_collection_ids(request, options = nil) - # Pass arguments to `list_collection_ids` via a request object, either of type - # {::Google::Cloud::Firestore::V1::ListCollectionIdsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::ListCollectionIdsRequest, ::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_collection_ids(parent: nil, page_size: nil, page_token: nil, read_time: nil) - # Pass arguments to `list_collection_ids` 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 document. In the format: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # For example: - # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - # @param page_size [::Integer] - # The maximum number of results to return. - # @param page_token [::String] - # A page token. Must be a value from - # {::Google::Cloud::Firestore::V1::ListCollectionIdsResponse ListCollectionIdsResponse}. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Reads documents as they were at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::V1::ListCollectionIdsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::V1::ListCollectionIdsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new - # - # # Call the list_collection_ids method. - # result = client.list_collection_ids request - # - # # The returned object is of type Google::Cloud::Firestore::V1::ListCollectionIdsResponse. - # p result - # - def list_collection_ids request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::ListCollectionIdsRequest - - # 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_collection_ids.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_collection_ids.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_collection_ids.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :list_collection_ids, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Applies a batch of write operations. - # - # The BatchWrite method does not apply the write operations atomically - # and can apply them out of order. Method does not allow more than one write - # per document. Each write succeeds or fails independently. See the - # {::Google::Cloud::Firestore::V1::BatchWriteResponse BatchWriteResponse} for the - # success status of each write. - # - # If you require an atomically applied set of writes, use - # {::Google::Cloud::Firestore::V1::Firestore::Client#commit Commit} instead. - # - # @overload batch_write(request, options = nil) - # Pass arguments to `batch_write` via a request object, either of type - # {::Google::Cloud::Firestore::V1::BatchWriteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::BatchWriteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_write(database: nil, writes: nil, labels: nil) - # Pass arguments to `batch_write` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @param writes [::Array<::Google::Cloud::Firestore::V1::Write, ::Hash>] - # The writes to apply. - # - # Method does not apply writes atomically and does not guarantee ordering. - # Each write succeeds or fails independently. You cannot write to the same - # document more than once per request. - # @param labels [::Hash{::String => ::String}] - # Labels associated with this batch write. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::V1::BatchWriteResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::V1::BatchWriteResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::BatchWriteRequest.new - # - # # Call the batch_write method. - # result = client.batch_write request - # - # # The returned object is of type Google::Cloud::Firestore::V1::BatchWriteResponse. - # p result - # - def batch_write request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::BatchWriteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_write.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.database - header_params["database"] = request.database - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_write.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_write.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :batch_write, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new document. - # - # @overload create_document(request, options = nil) - # Pass arguments to `create_document` via a request object, either of type - # {::Google::Cloud::Firestore::V1::CreateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::CreateDocumentRequest, ::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_document(parent: nil, collection_id: nil, document_id: nil, document: nil, mask: nil) - # Pass arguments to `create_document` 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 resource. For example: - # `projects/{project_id}/databases/{database_id}/documents` or - # `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` - # @param collection_id [::String] - # Required. The collection ID, relative to `parent`, to list. For example: - # `chatrooms`. - # @param document_id [::String] - # The client-assigned document ID to use for this document. - # - # Optional. If not specified, an ID will be assigned by the service. - # @param document [::Google::Cloud::Firestore::V1::Document, ::Hash] - # Required. The document to create. `name` must not be set. - # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] - # The fields to return. If not set, returns all fields. - # - # If the document has a field that is not present in this mask, that field - # will not be returned in the response. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Firestore::V1::Document] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Firestore::V1::Document] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::CreateDocumentRequest.new - # - # # Call the create_document method. - # result = client.create_document request - # - # # The returned object is of type Google::Cloud::Firestore::V1::Document. - # p result - # - def create_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::CreateDocumentRequest - - # 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_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - if request.collection_id - header_params["collection_id"] = request.collection_id - 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_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.call_rpc :create_document, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Firestore API. - # - # This class represents the configuration for Firestore, - # 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::V1::Firestore::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 - # # get_document to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Firestore::V1::Firestore::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_document.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_document.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "firestore.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Firestore 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 `get_document` - # @return [::Gapic::Config::Method] - # - attr_reader :get_document - ## - # RPC-specific configuration for `list_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :list_documents - ## - # RPC-specific configuration for `update_document` - # @return [::Gapic::Config::Method] - # - attr_reader :update_document - ## - # RPC-specific configuration for `delete_document` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_document - ## - # RPC-specific configuration for `batch_get_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_get_documents - ## - # RPC-specific configuration for `begin_transaction` - # @return [::Gapic::Config::Method] - # - attr_reader :begin_transaction - ## - # RPC-specific configuration for `commit` - # @return [::Gapic::Config::Method] - # - attr_reader :commit - ## - # RPC-specific configuration for `rollback` - # @return [::Gapic::Config::Method] - # - attr_reader :rollback - ## - # RPC-specific configuration for `run_query` - # @return [::Gapic::Config::Method] - # - attr_reader :run_query - ## - # RPC-specific configuration for `execute_pipeline` - # @return [::Gapic::Config::Method] - # - attr_reader :execute_pipeline - ## - # RPC-specific configuration for `run_aggregation_query` - # @return [::Gapic::Config::Method] - # - attr_reader :run_aggregation_query - ## - # RPC-specific configuration for `partition_query` - # @return [::Gapic::Config::Method] - # - attr_reader :partition_query - ## - # RPC-specific configuration for `write` - # @return [::Gapic::Config::Method] - # - attr_reader :write - ## - # RPC-specific configuration for `listen` - # @return [::Gapic::Config::Method] - # - attr_reader :listen - ## - # RPC-specific configuration for `list_collection_ids` - # @return [::Gapic::Config::Method] - # - attr_reader :list_collection_ids - ## - # RPC-specific configuration for `batch_write` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_write - ## - # RPC-specific configuration for `create_document` - # @return [::Gapic::Config::Method] - # - attr_reader :create_document - - # @private - def initialize parent_rpcs = nil - get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document - @get_document = ::Gapic::Config::Method.new get_document_config - list_documents_config = parent_rpcs.list_documents if parent_rpcs.respond_to? :list_documents - @list_documents = ::Gapic::Config::Method.new list_documents_config - update_document_config = parent_rpcs.update_document if parent_rpcs.respond_to? :update_document - @update_document = ::Gapic::Config::Method.new update_document_config - delete_document_config = parent_rpcs.delete_document if parent_rpcs.respond_to? :delete_document - @delete_document = ::Gapic::Config::Method.new delete_document_config - batch_get_documents_config = parent_rpcs.batch_get_documents if parent_rpcs.respond_to? :batch_get_documents - @batch_get_documents = ::Gapic::Config::Method.new batch_get_documents_config - begin_transaction_config = parent_rpcs.begin_transaction if parent_rpcs.respond_to? :begin_transaction - @begin_transaction = ::Gapic::Config::Method.new begin_transaction_config - commit_config = parent_rpcs.commit if parent_rpcs.respond_to? :commit - @commit = ::Gapic::Config::Method.new commit_config - rollback_config = parent_rpcs.rollback if parent_rpcs.respond_to? :rollback - @rollback = ::Gapic::Config::Method.new rollback_config - run_query_config = parent_rpcs.run_query if parent_rpcs.respond_to? :run_query - @run_query = ::Gapic::Config::Method.new run_query_config - execute_pipeline_config = parent_rpcs.execute_pipeline if parent_rpcs.respond_to? :execute_pipeline - @execute_pipeline = ::Gapic::Config::Method.new execute_pipeline_config - run_aggregation_query_config = parent_rpcs.run_aggregation_query if parent_rpcs.respond_to? :run_aggregation_query - @run_aggregation_query = ::Gapic::Config::Method.new run_aggregation_query_config - partition_query_config = parent_rpcs.partition_query if parent_rpcs.respond_to? :partition_query - @partition_query = ::Gapic::Config::Method.new partition_query_config - write_config = parent_rpcs.write if parent_rpcs.respond_to? :write - @write = ::Gapic::Config::Method.new write_config - listen_config = parent_rpcs.listen if parent_rpcs.respond_to? :listen - @listen = ::Gapic::Config::Method.new listen_config - list_collection_ids_config = parent_rpcs.list_collection_ids if parent_rpcs.respond_to? :list_collection_ids - @list_collection_ids = ::Gapic::Config::Method.new list_collection_ids_config - batch_write_config = parent_rpcs.batch_write if parent_rpcs.respond_to? :batch_write - @batch_write = ::Gapic::Config::Method.new batch_write_config - create_document_config = parent_rpcs.create_document if parent_rpcs.respond_to? :create_document - @create_document = ::Gapic::Config::Method.new create_document_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/credentials.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/credentials.rb deleted file mode 100644 index b86cdeb94a6f..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Firestore - module V1 - module Firestore - # Credentials for the Firestore 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 diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest.rb deleted file mode 100644 index a26df12bed6b..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/firestore/v1/version" - -require "google/cloud/firestore/v1/firestore/credentials" -require "google/cloud/firestore/v1/firestore/rest/client" - -module Google - module Cloud - module Firestore - module V1 - ## - # The Cloud Firestore service. - # - # Cloud Firestore is a fast, fully managed, serverless, cloud-native NoSQL - # document database that simplifies storing, syncing, and querying data for - # your mobile, web, and IoT apps at global scale. Its client libraries provide - # live synchronization and offline support, while its security features and - # integrations with Firebase and Google Cloud Platform accelerate building - # truly serverless apps. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/firestore/v1/firestore/rest" - # client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - module Firestore - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/firestore/v1/firestore/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb deleted file mode 100644 index d3785c733a81..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb +++ /dev/null @@ -1,2079 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/firestore/v1/firestore_pb" -require "google/cloud/firestore/v1/firestore/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Firestore - module V1 - module Firestore - module Rest - ## - # REST client for the Firestore service. - # - # The Cloud Firestore service. - # - # Cloud Firestore is a fast, fully managed, serverless, cloud-native NoSQL - # document database that simplifies storing, syncing, and querying data for - # your mobile, web, and IoT apps at global scale. Its client libraries provide - # live synchronization and offline support, while its security features and - # integrations with Firebase and Google Cloud Platform accelerate building - # truly serverless apps. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "firestore.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :firestore_stub - - ## - # Configure the Firestore Client class. - # - # See {::Google::Cloud::Firestore::V1::Firestore::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Firestore clients - # ::Google::Cloud::Firestore::V1::Firestore::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", "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.get_document.timeout = 60.0 - default_config.rpcs.get_document.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] - } - - default_config.rpcs.list_documents.timeout = 60.0 - default_config.rpcs.list_documents.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] - } - - default_config.rpcs.update_document.timeout = 60.0 - default_config.rpcs.update_document.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14] - } - - default_config.rpcs.delete_document.timeout = 60.0 - default_config.rpcs.delete_document.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] - } - - default_config.rpcs.batch_get_documents.timeout = 300.0 - default_config.rpcs.batch_get_documents.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.begin_transaction.timeout = 60.0 - default_config.rpcs.begin_transaction.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] - } - - default_config.rpcs.commit.timeout = 60.0 - default_config.rpcs.commit.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14] - } - - default_config.rpcs.rollback.timeout = 60.0 - default_config.rpcs.rollback.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] - } - - default_config.rpcs.run_query.timeout = 300.0 - default_config.rpcs.run_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.execute_pipeline.timeout = 300.0 - default_config.rpcs.execute_pipeline.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.run_aggregation_query.timeout = 300.0 - default_config.rpcs.run_aggregation_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.partition_query.timeout = 300.0 - default_config.rpcs.partition_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 13, 4] - } - - default_config.rpcs.list_collection_ids.timeout = 60.0 - default_config.rpcs.list_collection_ids.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4] - } - - default_config.rpcs.batch_write.timeout = 60.0 - default_config.rpcs.batch_write.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 10] - } - - default_config.rpcs.create_document.timeout = 60.0 - default_config.rpcs.create_document.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Firestore 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::V1::Firestore::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_stub.universe_domain - end - - ## - # Create a new Firestore REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Firestore 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 - - @firestore_stub = ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @firestore_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @firestore_stub.endpoint - config.universe_domain = @firestore_stub.universe_domain - config.logger = @firestore_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @firestore_stub.logger - end - - # Service calls - - ## - # Gets a single document. - # - # @overload get_document(request, options = nil) - # Pass arguments to `get_document` via a request object, either of type - # {::Google::Cloud::Firestore::V1::GetDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::GetDocumentRequest, ::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_document(name: nil, mask: nil, transaction: nil, read_time: nil) - # Pass arguments to `get_document` 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 resource name of the Document to get. In the format: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] - # The fields to return. If not set, returns all fields. - # - # If the document has a field that is not present in this mask, that field - # will not be returned in the response. - # @param transaction [::String] - # Reads the document in a transaction. - # - # Note: The following parameters are mutually exclusive: `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Reads the version of the document at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following parameters are mutually exclusive: `read_time`, `transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::V1::Document] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::Document] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::GetDocumentRequest.new - # - # # Call the get_document method. - # result = client.get_document request - # - # # The returned object is of type Google::Cloud::Firestore::V1::Document. - # p result - # - def get_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::GetDocumentRequest - - # 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_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_document.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.get_document request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists documents. - # - # @overload list_documents(request, options = nil) - # Pass arguments to `list_documents` via a request object, either of type - # {::Google::Cloud::Firestore::V1::ListDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::ListDocumentsRequest, ::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_documents(parent: nil, collection_id: nil, page_size: nil, page_token: nil, order_by: nil, mask: nil, transaction: nil, read_time: nil, show_missing: nil) - # Pass arguments to `list_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 parent [::String] - # Required. The parent resource name. In the format: - # `projects/{project_id}/databases/{database_id}/documents` or - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # - # For example: - # `projects/my-project/databases/my-database/documents` or - # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - # @param collection_id [::String] - # Optional. The collection ID, relative to `parent`, to list. - # - # For example: `chatrooms` or `messages`. - # - # This is optional, and when not provided, Firestore will list documents - # from all collections under the provided `parent`. - # @param page_size [::Integer] - # Optional. The maximum number of documents to return in a single response. - # - # Firestore may return fewer than this value. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListDocuments` response. - # - # Provide this to retrieve the subsequent page. When paginating, all other - # parameters (with the exception of `page_size`) must match the values set - # in the request that generated the page token. - # @param order_by [::String] - # Optional. The optional ordering of the documents to return. - # - # For example: `priority desc, __name__ desc`. - # - # This mirrors the {::Google::Cloud::Firestore::V1::StructuredQuery#order_by `ORDER BY`} - # used in Firestore queries but in a string representation. When absent, - # documents are ordered based on `__name__ ASC`. - # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] - # Optional. The fields to return. If not set, returns all fields. - # - # If a document has a field that is not present in this mask, that field - # will not be returned in the response. - # @param transaction [::String] - # Perform the read as part of an already active transaction. - # - # Note: The following parameters are mutually exclusive: `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Perform the read at the provided time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following parameters are mutually exclusive: `read_time`, `transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param show_missing [::Boolean] - # If the list should show missing documents. - # - # A document is missing if it does not exist, but there are sub-documents - # nested underneath it. When true, such missing documents will be returned - # with a key but will not have fields, - # {::Google::Cloud::Firestore::V1::Document#create_time `create_time`}, or - # {::Google::Cloud::Firestore::V1::Document#update_time `update_time`} set. - # - # Requests with `show_missing` may not specify `where` or `order_by`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::V1::Document>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::V1::Document>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::ListDocumentsRequest.new - # - # # Call the list_documents method. - # result = client.list_documents 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::V1::Document. - # p item - # end - # - def list_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::ListDocumentsRequest - - # 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_documents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_documents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.list_documents request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @firestore_stub, :list_documents, "documents", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates or inserts a document. - # - # @overload update_document(request, options = nil) - # Pass arguments to `update_document` via a request object, either of type - # {::Google::Cloud::Firestore::V1::UpdateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::UpdateDocumentRequest, ::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_document(document: nil, update_mask: nil, mask: nil, current_document: nil) - # Pass arguments to `update_document` 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 document [::Google::Cloud::Firestore::V1::Document, ::Hash] - # Required. The updated document. - # Creates the document if it does not already exist. - # @param update_mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] - # The fields to update. - # None of the field paths in the mask may contain a reserved name. - # - # If the document exists on the server and has fields not referenced in the - # mask, they are left unchanged. - # Fields referenced in the mask, but not present in the input document, are - # deleted from the document on the server. - # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] - # The fields to return. If not set, returns all fields. - # - # If the document has a field that is not present in this mask, that field - # will not be returned in the response. - # @param current_document [::Google::Cloud::Firestore::V1::Precondition, ::Hash] - # An optional precondition on the document. - # The request will fail if this is set and not met by the target document. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::V1::Document] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::Document] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::UpdateDocumentRequest.new - # - # # Call the update_document method. - # result = client.update_document request - # - # # The returned object is of type Google::Cloud::Firestore::V1::Document. - # p result - # - def update_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::UpdateDocumentRequest - - # 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_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_document.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.update_document request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a document. - # - # @overload delete_document(request, options = nil) - # Pass arguments to `delete_document` via a request object, either of type - # {::Google::Cloud::Firestore::V1::DeleteDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::DeleteDocumentRequest, ::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_document(name: nil, current_document: nil) - # Pass arguments to `delete_document` 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 resource name of the Document to delete. In the format: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # @param current_document [::Google::Cloud::Firestore::V1::Precondition, ::Hash] - # An optional precondition on the document. - # The request will fail if this is set and not met by the target document. - # @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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::DeleteDocumentRequest.new - # - # # Call the delete_document method. - # result = client.delete_document request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::DeleteDocumentRequest - - # 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_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_document.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.delete_document request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets multiple documents. - # - # Documents returned by this method are not guaranteed to be returned in the - # same order that they were requested. - # - # @overload batch_get_documents(request, options = nil) - # Pass arguments to `batch_get_documents` via a request object, either of type - # {::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_get_documents(database: nil, documents: nil, mask: nil, transaction: nil, new_transaction: nil, read_time: nil) - # Pass arguments to `batch_get_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 database [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @param documents [::Array<::String>] - # The names of the documents to retrieve. In the format: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # The request will fail if any of the document is not a child resource of the - # given `database`. Duplicate names will be elided. - # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] - # The fields to return. If not set, returns all fields. - # - # If a document has a field that is not present in this mask, that field will - # not be returned in the response. - # @param transaction [::String] - # Reads documents in a transaction. - # - # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] - # Starts a new transaction and reads the documents. - # Defaults to a read-only transaction. - # The new transaction ID will be returned as the first response in the - # stream. - # - # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Reads documents as they were at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @return [::Enumerable<::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new - # - # # Call the batch_get_documents method to start streaming. - # output = client.batch_get_documents request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse - # output.each do |current_response| - # p current_response - # end - # - def batch_get_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest - - # 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.batch_get_documents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_get_documents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_get_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - ::Gapic::Rest::ServerStream.new( - ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse, - ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| - @firestore_stub.batch_get_documents request, options do |chunk| - in_q.deq - out_q.enq chunk - end - end - ) - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts a new transaction. - # - # @overload begin_transaction(request, options = nil) - # Pass arguments to `begin_transaction` via a request object, either of type - # {::Google::Cloud::Firestore::V1::BeginTransactionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::BeginTransactionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload begin_transaction(database: nil, options: nil) - # Pass arguments to `begin_transaction` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @param options [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] - # The options for the transaction. - # Defaults to a read-write transaction. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::V1::BeginTransactionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::BeginTransactionResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::BeginTransactionRequest.new - # - # # Call the begin_transaction method. - # result = client.begin_transaction request - # - # # The returned object is of type Google::Cloud::Firestore::V1::BeginTransactionResponse. - # p result - # - def begin_transaction request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::BeginTransactionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.begin_transaction.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.begin_transaction.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.begin_transaction.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.begin_transaction request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Commits a transaction, while optionally updating documents. - # - # @overload commit(request, options = nil) - # Pass arguments to `commit` via a request object, either of type - # {::Google::Cloud::Firestore::V1::CommitRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::CommitRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload commit(database: nil, writes: nil, transaction: nil) - # Pass arguments to `commit` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @param writes [::Array<::Google::Cloud::Firestore::V1::Write, ::Hash>] - # The writes to apply. - # - # Always executed atomically and in order. - # @param transaction [::String] - # If set, applies all writes in this transaction, and commits it. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::V1::CommitResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::CommitResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::CommitRequest.new - # - # # Call the commit method. - # result = client.commit request - # - # # The returned object is of type Google::Cloud::Firestore::V1::CommitResponse. - # p result - # - def commit request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::CommitRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.commit.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.commit.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.commit.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.commit request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Rolls back a transaction. - # - # @overload rollback(request, options = nil) - # Pass arguments to `rollback` via a request object, either of type - # {::Google::Cloud::Firestore::V1::RollbackRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::RollbackRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload rollback(database: nil, transaction: nil) - # Pass arguments to `rollback` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @param transaction [::String] - # Required. The transaction to roll back. - # @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/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::RollbackRequest.new - # - # # Call the rollback method. - # result = client.rollback request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def rollback request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::RollbackRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.rollback.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.rollback.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.rollback.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.rollback request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Runs a query. - # - # @overload run_query(request, options = nil) - # Pass arguments to `run_query` via a request object, either of type - # {::Google::Cloud::Firestore::V1::RunQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::RunQueryRequest, ::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 run_query(parent: nil, structured_query: nil, transaction: nil, new_transaction: nil, read_time: nil, explain_options: nil) - # Pass arguments to `run_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name. In the format: - # `projects/{project_id}/databases/{database_id}/documents` or - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # For example: - # `projects/my-project/databases/my-database/documents` or - # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - # @param structured_query [::Google::Cloud::Firestore::V1::StructuredQuery, ::Hash] - # A structured query. - # @param transaction [::String] - # Run the query within an already active transaction. - # - # The value here is the opaque transaction ID to execute the query in. - # - # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] - # Starts a new transaction and reads the documents. - # Defaults to a read-only transaction. - # The new transaction ID will be returned as the first response in the - # stream. - # - # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Reads documents as they were at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param explain_options [::Google::Cloud::Firestore::V1::ExplainOptions, ::Hash] - # Optional. Explain options for the query. If set, additional query - # statistics will be returned. If not, only query results will be returned. - # @return [::Enumerable<::Google::Cloud::Firestore::V1::RunQueryResponse>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::RunQueryRequest.new - # - # # Call the run_query method to start streaming. - # output = client.run_query request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Firestore::V1::RunQueryResponse - # output.each do |current_response| - # p current_response - # end - # - def run_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::RunQueryRequest - - # 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.run_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.run_query.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.run_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - ::Gapic::Rest::ServerStream.new( - ::Google::Cloud::Firestore::V1::RunQueryResponse, - ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| - @firestore_stub.run_query request, options do |chunk| - in_q.deq - out_q.enq chunk - end - end - ) - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Executes a pipeline query. - # - # @overload execute_pipeline(request, options = nil) - # Pass arguments to `execute_pipeline` via a request object, either of type - # {::Google::Cloud::Firestore::V1::ExecutePipelineRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::ExecutePipelineRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload execute_pipeline(database: nil, structured_pipeline: nil, transaction: nil, new_transaction: nil, read_time: nil) - # Pass arguments to `execute_pipeline` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. Database identifier, in the form - # `projects/{project}/databases/{database}`. - # @param structured_pipeline [::Google::Cloud::Firestore::V1::StructuredPipeline, ::Hash] - # A pipelined operation. - # @param transaction [::String] - # Run the query within an already active transaction. - # - # The value here is the opaque transaction ID to execute the query in. - # - # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] - # Execute the pipeline in a new transaction. - # - # The identifier of the newly created transaction will be returned in the - # first response on the stream. This defaults to a read-only transaction. - # - # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Execute the pipeline in a snapshot transaction at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @return [::Enumerable<::Google::Cloud::Firestore::V1::ExecutePipelineResponse>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::ExecutePipelineRequest.new - # - # # Call the execute_pipeline method to start streaming. - # output = client.execute_pipeline request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Firestore::V1::ExecutePipelineResponse - # output.each do |current_response| - # p current_response - # end - # - def execute_pipeline request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::ExecutePipelineRequest - - # 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.execute_pipeline.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.execute_pipeline.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.execute_pipeline.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - ::Gapic::Rest::ServerStream.new( - ::Google::Cloud::Firestore::V1::ExecutePipelineResponse, - ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| - @firestore_stub.execute_pipeline request, options do |chunk| - in_q.deq - out_q.enq chunk - end - end - ) - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Runs an aggregation query. - # - # Rather than producing {::Google::Cloud::Firestore::V1::Document Document} results like - # {::Google::Cloud::Firestore::V1::Firestore::Rest::Client#run_query Firestore.RunQuery}, this API - # allows running an aggregation to produce a series of - # {::Google::Cloud::Firestore::V1::AggregationResult AggregationResult} server-side. - # - # High-Level Example: - # - # ``` - # -- Return the number of documents in table given a filter. - # SELECT COUNT(*) FROM ( SELECT * FROM k where a = true ); - # ``` - # - # @overload run_aggregation_query(request, options = nil) - # Pass arguments to `run_aggregation_query` via a request object, either of type - # {::Google::Cloud::Firestore::V1::RunAggregationQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::RunAggregationQueryRequest, ::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 run_aggregation_query(parent: nil, structured_aggregation_query: nil, transaction: nil, new_transaction: nil, read_time: nil, explain_options: nil) - # Pass arguments to `run_aggregation_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name. In the format: - # `projects/{project_id}/databases/{database_id}/documents` or - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # For example: - # `projects/my-project/databases/my-database/documents` or - # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - # @param structured_aggregation_query [::Google::Cloud::Firestore::V1::StructuredAggregationQuery, ::Hash] - # An aggregation query. - # @param transaction [::String] - # Run the aggregation within an already active transaction. - # - # The value here is the opaque transaction ID to execute the query in. - # - # Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param new_transaction [::Google::Cloud::Firestore::V1::TransactionOptions, ::Hash] - # Starts a new transaction as part of the query, defaulting to read-only. - # - # The new transaction ID will be returned as the first response in the - # stream. - # - # Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Executes the query at the given timestamp. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param explain_options [::Google::Cloud::Firestore::V1::ExplainOptions, ::Hash] - # Optional. Explain options for the query. If set, additional query - # statistics will be returned. If not, only query results will be returned. - # @return [::Enumerable<::Google::Cloud::Firestore::V1::RunAggregationQueryResponse>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new - # - # # Call the run_aggregation_query method to start streaming. - # output = client.run_aggregation_query request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse - # output.each do |current_response| - # p current_response - # end - # - def run_aggregation_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::RunAggregationQueryRequest - - # 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.run_aggregation_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.run_aggregation_query.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.run_aggregation_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - ::Gapic::Rest::ServerStream.new( - ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse, - ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| - @firestore_stub.run_aggregation_query request, options do |chunk| - in_q.deq - out_q.enq chunk - end - end - ) - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Partitions a query by returning partition cursors that can be used to run - # the query in parallel. The returned partition cursors are split points that - # can be used by RunQuery as starting/end points for the query results. - # - # @overload partition_query(request, options = nil) - # Pass arguments to `partition_query` via a request object, either of type - # {::Google::Cloud::Firestore::V1::PartitionQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::PartitionQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload partition_query(parent: nil, structured_query: nil, partition_count: nil, page_token: nil, page_size: nil, read_time: nil) - # Pass arguments to `partition_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name. In the format: - # `projects/{project_id}/databases/{database_id}/documents`. - # Document resource names are not supported; only database resource names - # can be specified. - # @param structured_query [::Google::Cloud::Firestore::V1::StructuredQuery, ::Hash] - # A structured query. - # Query must specify collection with all descendants and be ordered by name - # ascending. Other filters, order bys, limits, offsets, and start/end - # cursors are not supported. - # @param partition_count [::Integer] - # The desired maximum number of partition points. - # The partitions may be returned across multiple pages of results. - # The number must be positive. The actual number of partitions - # returned may be fewer. - # - # For example, this may be set to one fewer than the number of parallel - # queries to be run, or in running a data pipeline job, one fewer than the - # number of workers or compute instances available. - # @param page_token [::String] - # The `next_page_token` value returned from a previous call to - # PartitionQuery that may be used to get an additional set of results. - # There are no ordering guarantees between sets of results. Thus, using - # multiple sets of results will require merging the different result sets. - # - # For example, two subsequent calls using a page_token may return: - # - # * cursor B, cursor M, cursor Q - # * cursor A, cursor U, cursor W - # - # To obtain a complete result set ordered with respect to the results of the - # query supplied to PartitionQuery, the results sets should be merged: - # cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W - # @param page_size [::Integer] - # The maximum number of partitions to return in this call, subject to - # `partition_count`. - # - # For example, if `partition_count` = 10 and `page_size` = 8, the first call - # to PartitionQuery will return up to 8 partitions and a `next_page_token` - # if more results exist. A second call to PartitionQuery will return up to - # 2 partitions, to complete the total of 10 specified in `partition_count`. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Reads documents as they were at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::V1::Cursor>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::V1::Cursor>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::PartitionQueryRequest.new - # - # # Call the partition_query method. - # result = client.partition_query 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::V1::Cursor. - # p item - # end - # - def partition_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::PartitionQueryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.partition_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.partition_query.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.partition_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.partition_query request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @firestore_stub, :partition_query, "partitions", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the collection IDs underneath a document. - # - # @overload list_collection_ids(request, options = nil) - # Pass arguments to `list_collection_ids` via a request object, either of type - # {::Google::Cloud::Firestore::V1::ListCollectionIdsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::ListCollectionIdsRequest, ::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_collection_ids(parent: nil, page_size: nil, page_token: nil, read_time: nil) - # Pass arguments to `list_collection_ids` 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 document. In the format: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # For example: - # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - # @param page_size [::Integer] - # The maximum number of results to return. - # @param page_token [::String] - # A page token. Must be a value from - # {::Google::Cloud::Firestore::V1::ListCollectionIdsResponse ListCollectionIdsResponse}. - # @param read_time [::Google::Protobuf::Timestamp, ::Hash] - # Reads documents as they were at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::V1::ListCollectionIdsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::ListCollectionIdsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new - # - # # Call the list_collection_ids method. - # result = client.list_collection_ids request - # - # # The returned object is of type Google::Cloud::Firestore::V1::ListCollectionIdsResponse. - # p result - # - def list_collection_ids request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::ListCollectionIdsRequest - - # 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_collection_ids.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_collection_ids.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_collection_ids.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.list_collection_ids request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Applies a batch of write operations. - # - # The BatchWrite method does not apply the write operations atomically - # and can apply them out of order. Method does not allow more than one write - # per document. Each write succeeds or fails independently. See the - # {::Google::Cloud::Firestore::V1::BatchWriteResponse BatchWriteResponse} for the - # success status of each write. - # - # If you require an atomically applied set of writes, use - # {::Google::Cloud::Firestore::V1::Firestore::Rest::Client#commit Commit} instead. - # - # @overload batch_write(request, options = nil) - # Pass arguments to `batch_write` via a request object, either of type - # {::Google::Cloud::Firestore::V1::BatchWriteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::BatchWriteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_write(database: nil, writes: nil, labels: nil) - # Pass arguments to `batch_write` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param database [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @param writes [::Array<::Google::Cloud::Firestore::V1::Write, ::Hash>] - # The writes to apply. - # - # Method does not apply writes atomically and does not guarantee ordering. - # Each write succeeds or fails independently. You cannot write to the same - # document more than once per request. - # @param labels [::Hash{::String => ::String}] - # Labels associated with this batch write. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::V1::BatchWriteResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::BatchWriteResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::BatchWriteRequest.new - # - # # Call the batch_write method. - # result = client.batch_write request - # - # # The returned object is of type Google::Cloud::Firestore::V1::BatchWriteResponse. - # p result - # - def batch_write request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::BatchWriteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.batch_write.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_write.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_write.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.batch_write request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new document. - # - # @overload create_document(request, options = nil) - # Pass arguments to `create_document` via a request object, either of type - # {::Google::Cloud::Firestore::V1::CreateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Firestore::V1::CreateDocumentRequest, ::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_document(parent: nil, collection_id: nil, document_id: nil, document: nil, mask: nil) - # Pass arguments to `create_document` 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 resource. For example: - # `projects/{project_id}/databases/{database_id}/documents` or - # `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` - # @param collection_id [::String] - # Required. The collection ID, relative to `parent`, to list. For example: - # `chatrooms`. - # @param document_id [::String] - # The client-assigned document ID to use for this document. - # - # Optional. If not specified, an ID will be assigned by the service. - # @param document [::Google::Cloud::Firestore::V1::Document, ::Hash] - # Required. The document to create. `name` must not be set. - # @param mask [::Google::Cloud::Firestore::V1::DocumentMask, ::Hash] - # The fields to return. If not set, returns all fields. - # - # If the document has a field that is not present in this mask, that field - # will not be returned in the response. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Firestore::V1::Document] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::Document] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/firestore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Firestore::V1::CreateDocumentRequest.new - # - # # Call the create_document method. - # result = client.create_document request - # - # # The returned object is of type Google::Cloud::Firestore::V1::Document. - # p result - # - def create_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::V1::CreateDocumentRequest - - # 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_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Firestore::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_document.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @firestore_stub.create_document request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Firestore REST API. - # - # This class represents the configuration for Firestore 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::V1::Firestore::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 - # # get_document to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_document.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_document.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "firestore.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Firestore 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 `get_document` - # @return [::Gapic::Config::Method] - # - attr_reader :get_document - ## - # RPC-specific configuration for `list_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :list_documents - ## - # RPC-specific configuration for `update_document` - # @return [::Gapic::Config::Method] - # - attr_reader :update_document - ## - # RPC-specific configuration for `delete_document` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_document - ## - # RPC-specific configuration for `batch_get_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_get_documents - ## - # RPC-specific configuration for `begin_transaction` - # @return [::Gapic::Config::Method] - # - attr_reader :begin_transaction - ## - # RPC-specific configuration for `commit` - # @return [::Gapic::Config::Method] - # - attr_reader :commit - ## - # RPC-specific configuration for `rollback` - # @return [::Gapic::Config::Method] - # - attr_reader :rollback - ## - # RPC-specific configuration for `run_query` - # @return [::Gapic::Config::Method] - # - attr_reader :run_query - ## - # RPC-specific configuration for `execute_pipeline` - # @return [::Gapic::Config::Method] - # - attr_reader :execute_pipeline - ## - # RPC-specific configuration for `run_aggregation_query` - # @return [::Gapic::Config::Method] - # - attr_reader :run_aggregation_query - ## - # RPC-specific configuration for `partition_query` - # @return [::Gapic::Config::Method] - # - attr_reader :partition_query - ## - # RPC-specific configuration for `list_collection_ids` - # @return [::Gapic::Config::Method] - # - attr_reader :list_collection_ids - ## - # RPC-specific configuration for `batch_write` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_write - ## - # RPC-specific configuration for `create_document` - # @return [::Gapic::Config::Method] - # - attr_reader :create_document - - # @private - def initialize parent_rpcs = nil - get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document - @get_document = ::Gapic::Config::Method.new get_document_config - list_documents_config = parent_rpcs.list_documents if parent_rpcs.respond_to? :list_documents - @list_documents = ::Gapic::Config::Method.new list_documents_config - update_document_config = parent_rpcs.update_document if parent_rpcs.respond_to? :update_document - @update_document = ::Gapic::Config::Method.new update_document_config - delete_document_config = parent_rpcs.delete_document if parent_rpcs.respond_to? :delete_document - @delete_document = ::Gapic::Config::Method.new delete_document_config - batch_get_documents_config = parent_rpcs.batch_get_documents if parent_rpcs.respond_to? :batch_get_documents - @batch_get_documents = ::Gapic::Config::Method.new batch_get_documents_config - begin_transaction_config = parent_rpcs.begin_transaction if parent_rpcs.respond_to? :begin_transaction - @begin_transaction = ::Gapic::Config::Method.new begin_transaction_config - commit_config = parent_rpcs.commit if parent_rpcs.respond_to? :commit - @commit = ::Gapic::Config::Method.new commit_config - rollback_config = parent_rpcs.rollback if parent_rpcs.respond_to? :rollback - @rollback = ::Gapic::Config::Method.new rollback_config - run_query_config = parent_rpcs.run_query if parent_rpcs.respond_to? :run_query - @run_query = ::Gapic::Config::Method.new run_query_config - execute_pipeline_config = parent_rpcs.execute_pipeline if parent_rpcs.respond_to? :execute_pipeline - @execute_pipeline = ::Gapic::Config::Method.new execute_pipeline_config - run_aggregation_query_config = parent_rpcs.run_aggregation_query if parent_rpcs.respond_to? :run_aggregation_query - @run_aggregation_query = ::Gapic::Config::Method.new run_aggregation_query_config - partition_query_config = parent_rpcs.partition_query if parent_rpcs.respond_to? :partition_query - @partition_query = ::Gapic::Config::Method.new partition_query_config - list_collection_ids_config = parent_rpcs.list_collection_ids if parent_rpcs.respond_to? :list_collection_ids - @list_collection_ids = ::Gapic::Config::Method.new list_collection_ids_config - batch_write_config = parent_rpcs.batch_write if parent_rpcs.respond_to? :batch_write - @batch_write = ::Gapic::Config::Method.new batch_write_config - create_document_config = parent_rpcs.create_document if parent_rpcs.respond_to? :create_document - @create_document = ::Gapic::Config::Method.new create_document_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-v1/lib/google/cloud/firestore/v1/firestore/rest/service_stub.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/service_stub.rb deleted file mode 100644 index 0cac6fe2306c..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/service_stub.rb +++ /dev/null @@ -1,1026 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/firestore/v1/firestore_pb" - -module Google - module Cloud - module Firestore - module V1 - module Firestore - module Rest - ## - # REST service stub for the Firestore service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the get_document REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::GetDocumentRequest] - # 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::V1::Document] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::Document] - # A result object deserialized from the server's reply - def get_document request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_document_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_document", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::V1::Document.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_documents REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::ListDocumentsRequest] - # 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::V1::ListDocumentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::ListDocumentsResponse] - # A result object deserialized from the server's reply - def list_documents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_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, - method_name: "list_documents", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::V1::ListDocumentsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_document REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::UpdateDocumentRequest] - # 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::V1::Document] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::Document] - # A result object deserialized from the server's reply - def update_document request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_document_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_document", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::V1::Document.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_document REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::DeleteDocumentRequest] - # 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_document request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_document_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_document", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_get_documents REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest] - # 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. - # - # @yieldparam chunk [::String] The chunk of data received during server streaming. - # - # @return [::Gapic::Rest::TransportOperation] - def batch_get_documents(request_pb, options = nil, &) - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_get_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, - method_name: "batch_get_documents", - options: options, - is_server_streaming: true, - & - ) - ::Gapic::Rest::TransportOperation.new response - end - - ## - # Baseline implementation for the begin_transaction REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::BeginTransactionRequest] - # 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::V1::BeginTransactionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::BeginTransactionResponse] - # A result object deserialized from the server's reply - def begin_transaction request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_begin_transaction_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "begin_transaction", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::V1::BeginTransactionResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the commit REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::CommitRequest] - # 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::V1::CommitResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::CommitResponse] - # A result object deserialized from the server's reply - def commit request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_commit_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "commit", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::V1::CommitResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the rollback REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::RollbackRequest] - # 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 rollback request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_rollback_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "rollback", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the run_query REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::RunQueryRequest] - # 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. - # - # @yieldparam chunk [::String] The chunk of data received during server streaming. - # - # @return [::Gapic::Rest::TransportOperation] - def run_query(request_pb, options = nil, &) - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_run_query_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "run_query", - options: options, - is_server_streaming: true, - & - ) - ::Gapic::Rest::TransportOperation.new response - end - - ## - # Baseline implementation for the execute_pipeline REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::ExecutePipelineRequest] - # 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. - # - # @yieldparam chunk [::String] The chunk of data received during server streaming. - # - # @return [::Gapic::Rest::TransportOperation] - def execute_pipeline(request_pb, options = nil, &) - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_execute_pipeline_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "execute_pipeline", - options: options, - is_server_streaming: true, - & - ) - ::Gapic::Rest::TransportOperation.new response - end - - ## - # Baseline implementation for the run_aggregation_query REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::RunAggregationQueryRequest] - # 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. - # - # @yieldparam chunk [::String] The chunk of data received during server streaming. - # - # @return [::Gapic::Rest::TransportOperation] - def run_aggregation_query(request_pb, options = nil, &) - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_run_aggregation_query_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "run_aggregation_query", - options: options, - is_server_streaming: true, - & - ) - ::Gapic::Rest::TransportOperation.new response - end - - ## - # Baseline implementation for the partition_query REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::PartitionQueryRequest] - # 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::V1::PartitionQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::PartitionQueryResponse] - # A result object deserialized from the server's reply - def partition_query request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_partition_query_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "partition_query", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::V1::PartitionQueryResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_collection_ids REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::ListCollectionIdsRequest] - # 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::V1::ListCollectionIdsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::ListCollectionIdsResponse] - # A result object deserialized from the server's reply - def list_collection_ids request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_collection_ids_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_collection_ids", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::V1::ListCollectionIdsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_write REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::BatchWriteRequest] - # 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::V1::BatchWriteResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::BatchWriteResponse] - # A result object deserialized from the server's reply - def batch_write request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_write_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "batch_write", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::V1::BatchWriteResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_document REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::CreateDocumentRequest] - # 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::V1::Document] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Firestore::V1::Document] - # A result object deserialized from the server's reply - def create_document request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_document_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_document", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Firestore::V1::Document.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the get_document REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::GetDocumentRequest] - # 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_document_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_documents REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::ListDocumentsRequest] - # 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_documents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/{collection_id}", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true], - ["collection_id", %r{^[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/{collection_id}", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/?$}, false], - ["collection_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_document REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::UpdateDocumentRequest] - # 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_document_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{document.name}", - body: "document", - matches: [ - ["document.name", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_document REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::DeleteDocumentRequest] - # 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_document_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_get_documents REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_get_documents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{database}/documents:batchGet", - body: "*", - matches: [ - ["database", %r{^projects/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the begin_transaction REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::BeginTransactionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_begin_transaction_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{database}/documents:beginTransaction", - body: "*", - matches: [ - ["database", %r{^projects/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the commit REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::CommitRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_commit_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{database}/documents:commit", - body: "*", - matches: [ - ["database", %r{^projects/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the rollback REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::RollbackRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_rollback_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{database}/documents:rollback", - body: "*", - matches: [ - ["database", %r{^projects/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_query REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::RunQueryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_run_query_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:runQuery", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:runQuery", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the execute_pipeline REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::ExecutePipelineRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_execute_pipeline_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{database}/documents:executePipeline", - body: "*", - matches: [ - ["database", %r{^projects/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_aggregation_query REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::RunAggregationQueryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_run_aggregation_query_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:runAggregationQuery", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:runAggregationQuery", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the partition_query REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::PartitionQueryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_partition_query_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:partitionQuery", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:partitionQuery", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_collection_ids REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::ListCollectionIdsRequest] - # 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_collection_ids_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:listCollectionIds", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:listCollectionIds", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/documents/[^/]+(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_write REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::BatchWriteRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_write_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{database}/documents:batchWrite", - body: "*", - matches: [ - ["database", %r{^projects/[^/]+/databases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_document REST call - # - # @param request_pb [::Google::Cloud::Firestore::V1::CreateDocumentRequest] - # 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_document_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/{collection_id}", - body: "document", - matches: [ - ["parent", %r{^projects/[^/]+/databases/[^/]+/documents(?:/.*)?$}, true], - ["collection_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/rest.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/rest.rb deleted file mode 100644 index 8498e99136a4..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/rest.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/firestore/v1/firestore/rest" -require "google/cloud/firestore/v1/version" - -module Google - module Cloud - module Firestore - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/firestore/v1/rest" - # client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/version.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/version.rb deleted file mode 100644 index 6398d674ba15..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Firestore - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/aggregation_result_pb.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/aggregation_result_pb.rb deleted file mode 100644 index 910e6f9fe80f..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/aggregation_result_pb.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/firestore/v1/aggregation_result.proto - -require 'google/protobuf' - -require 'google/firestore/v1/document_pb' - - -descriptor_data = "\n,google/firestore/v1/aggregation_result.proto\x12\x13google.firestore.v1\x1a\"google/firestore/v1/document.proto\"\xbe\x01\n\x11\x41ggregationResult\x12U\n\x10\x61ggregate_fields\x18\x02 \x03(\x0b\x32;.google.firestore.v1.AggregationResult.AggregateFieldsEntry\x1aR\n\x14\x41ggregateFieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\x42\xce\x01\n\x17\x63om.google.firestore.v1B\x16\x41ggregationResultProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::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.v1.Value", "google/firestore/v1/document.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 V1 - AggregationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.AggregationResult").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/bloom_filter_pb.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/bloom_filter_pb.rb deleted file mode 100644 index a633a3ae5e40..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/bloom_filter_pb.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/firestore/v1/bloom_filter.proto - -require 'google/protobuf' - - -descriptor_data = "\n&google/firestore/v1/bloom_filter.proto\x12\x13google.firestore.v1\".\n\x0b\x42itSequence\x12\x0e\n\x06\x62itmap\x18\x01 \x01(\x0c\x12\x0f\n\x07padding\x18\x02 \x01(\x05\"Q\n\x0b\x42loomFilter\x12.\n\x04\x62its\x18\x01 \x01(\x0b\x32 .google.firestore.v1.BitSequence\x12\x12\n\nhash_count\x18\x02 \x01(\x05\x42\xc8\x01\n\x17\x63om.google.firestore.v1B\x10\x42loomFilterProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::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 V1 - BitSequence = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.BitSequence").msgclass - BloomFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.BloomFilter").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/common_pb.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/common_pb.rb deleted file mode 100644 index e8950cc89c76..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/common_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/firestore/v1/common.proto - -require 'google/protobuf' - -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n google/firestore/v1/common.proto\x12\x13google.firestore.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"#\n\x0c\x44ocumentMask\x12\x13\n\x0b\x66ield_paths\x18\x01 \x03(\t\"e\n\x0cPrecondition\x12\x10\n\x06\x65xists\x18\x01 \x01(\x08H\x00\x12\x31\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x10\n\x0e\x63ondition_type\"\xa9\x02\n\x12TransactionOptions\x12\x45\n\tread_only\x18\x02 \x01(\x0b\x32\x30.google.firestore.v1.TransactionOptions.ReadOnlyH\x00\x12G\n\nread_write\x18\x03 \x01(\x0b\x32\x31.google.firestore.v1.TransactionOptions.ReadWriteH\x00\x1a&\n\tReadWrite\x12\x19\n\x11retry_transaction\x18\x01 \x01(\x0c\x1aS\n\x08ReadOnly\x12/\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x16\n\x14\x63onsistency_selectorB\x06\n\x04modeB\xc3\x01\n\x17\x63om.google.firestore.v1B\x0b\x43ommonProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::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 V1 - DocumentMask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.DocumentMask").msgclass - Precondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.Precondition").msgclass - TransactionOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.TransactionOptions").msgclass - TransactionOptions::ReadWrite = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.TransactionOptions.ReadWrite").msgclass - TransactionOptions::ReadOnly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.TransactionOptions.ReadOnly").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/document_pb.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/document_pb.rb deleted file mode 100644 index 8cf9b80c1e28..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/document_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/firestore/v1/document.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' -require 'google/type/latlng_pb' - - -descriptor_data = "\n\"google/firestore/v1/document.proto\x12\x13google.firestore.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x18google/type/latlng.proto\"\x80\x02\n\x08\x44ocument\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x39\n\x06\x66ields\x18\x02 \x03(\x0b\x32).google.firestore.v1.Document.FieldsEntry\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aI\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\"\xe5\x04\n\x05Value\x12\x30\n\nnull_value\x18\x0b \x01(\x0e\x32\x1a.google.protobuf.NullValueH\x00\x12\x17\n\rboolean_value\x18\x01 \x01(\x08H\x00\x12\x17\n\rinteger_value\x18\x02 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x03 \x01(\x01H\x00\x12\x35\n\x0ftimestamp_value\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x16\n\x0cstring_value\x18\x11 \x01(\tH\x00\x12\x15\n\x0b\x62ytes_value\x18\x12 \x01(\x0cH\x00\x12\x19\n\x0freference_value\x18\x05 \x01(\tH\x00\x12.\n\x0fgeo_point_value\x18\x08 \x01(\x0b\x32\x13.google.type.LatLngH\x00\x12\x36\n\x0b\x61rray_value\x18\t \x01(\x0b\x32\x1f.google.firestore.v1.ArrayValueH\x00\x12\x32\n\tmap_value\x18\x06 \x01(\x0b\x32\x1d.google.firestore.v1.MapValueH\x00\x12\x1f\n\x15\x66ield_reference_value\x18\x13 \x01(\tH\x00\x12\"\n\x18variable_reference_value\x18\x16 \x01(\tH\x00\x12\x37\n\x0e\x66unction_value\x18\x14 \x01(\x0b\x32\x1d.google.firestore.v1.FunctionH\x00\x12\x37\n\x0epipeline_value\x18\x15 \x01(\x0b\x32\x1d.google.firestore.v1.PipelineH\x00\x42\x0c\n\nvalue_type\"8\n\nArrayValue\x12*\n\x06values\x18\x01 \x03(\x0b\x32\x1a.google.firestore.v1.Value\"\x90\x01\n\x08MapValue\x12\x39\n\x06\x66ields\x18\x01 \x03(\x0b\x32).google.firestore.v1.MapValue.FieldsEntry\x1aI\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\"\xda\x01\n\x08\x46unction\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12-\n\x04\x61rgs\x18\x02 \x03(\x0b\x32\x1a.google.firestore.v1.ValueB\x03\xe0\x41\x01\x12@\n\x07options\x18\x03 \x03(\x0b\x32*.google.firestore.v1.Function.OptionsEntryB\x03\xe0\x41\x01\x1aJ\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\"\xa4\x02\n\x08Pipeline\x12\x38\n\x06stages\x18\x01 \x03(\x0b\x32#.google.firestore.v1.Pipeline.StageB\x03\xe0\x41\x02\x1a\xdd\x01\n\x05Stage\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12-\n\x04\x61rgs\x18\x02 \x03(\x0b\x32\x1a.google.firestore.v1.ValueB\x03\xe0\x41\x01\x12\x46\n\x07options\x18\x03 \x03(\x0b\x32\x30.google.firestore.v1.Pipeline.Stage.OptionsEntryB\x03\xe0\x41\x01\x1aJ\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\x42\xc5\x01\n\x17\x63om.google.firestore.v1B\rDocumentProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::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.type.LatLng", "google/type/latlng.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 V1 - Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.Document").msgclass - Value = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.Value").msgclass - ArrayValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.ArrayValue").msgclass - MapValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.MapValue").msgclass - Function = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.Function").msgclass - Pipeline = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.Pipeline").msgclass - Pipeline::Stage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.Pipeline.Stage").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/explain_stats_pb.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/explain_stats_pb.rb deleted file mode 100644 index 8502d71e7acf..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/explain_stats_pb.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/firestore/v1/explain_stats.proto - -require 'google/protobuf' - -require 'google/protobuf/any_pb' - - -descriptor_data = "\n\'google/firestore/v1/explain_stats.proto\x12\x13google.firestore.v1\x1a\x19google/protobuf/any.proto\"2\n\x0c\x45xplainStats\x12\"\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x14.google.protobuf.AnyB\xc2\x01\n\x17\x63om.google.firestore.v1B\x11\x45xplainStatsProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::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.Any", "google/protobuf/any.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 V1 - ExplainStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.ExplainStats").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/firestore_pb.rb b/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/firestore_pb.rb deleted file mode 100644 index ac0e1b9e7e37..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/lib/google/firestore/v1/firestore_pb.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/firestore/v1/firestore.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/routing_pb' -require 'google/firestore/v1/aggregation_result_pb' -require 'google/firestore/v1/common_pb' -require 'google/firestore/v1/document_pb' -require 'google/firestore/v1/explain_stats_pb' -require 'google/firestore/v1/pipeline_pb' -require 'google/firestore/v1/query_pb' -require 'google/firestore/v1/query_profile_pb' -require 'google/firestore/v1/write_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/timestamp_pb' -require 'google/protobuf/wrappers_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n#google/firestore/v1/firestore.proto\x12\x13google.firestore.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x18google/api/routing.proto\x1a,google/firestore/v1/aggregation_result.proto\x1a google/firestore/v1/common.proto\x1a\"google/firestore/v1/document.proto\x1a\'google/firestore/v1/explain_stats.proto\x1a\"google/firestore/v1/pipeline.proto\x1a\x1fgoogle/firestore/v1/query.proto\x1a\'google/firestore/v1/query_profile.proto\x1a\x1fgoogle/firestore/v1/write.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x17google/rpc/status.proto\"\xb8\x01\n\x12GetDocumentRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12/\n\x04mask\x18\x02 \x01(\x0b\x32!.google.firestore.v1.DocumentMask\x12\x15\n\x0btransaction\x18\x03 \x01(\x0cH\x00\x12/\n\tread_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x16\n\x14\x63onsistency_selector\"\xbb\x02\n\x14ListDocumentsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rcollection_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x04mask\x18\x07 \x01(\x0b\x32!.google.firestore.v1.DocumentMaskB\x03\xe0\x41\x01\x12\x15\n\x0btransaction\x18\x08 \x01(\x0cH\x00\x12/\n\tread_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x14\n\x0cshow_missing\x18\x0c \x01(\x08\x42\x16\n\x14\x63onsistency_selector\"b\n\x15ListDocumentsResponse\x12\x30\n\tdocuments\x18\x01 \x03(\x0b\x32\x1d.google.firestore.v1.Document\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xc4\x01\n\x15\x43reateDocumentRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rcollection_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64ocument_id\x18\x03 \x01(\t\x12\x34\n\x08\x64ocument\x18\x04 \x01(\x0b\x32\x1d.google.firestore.v1.DocumentB\x03\xe0\x41\x02\x12/\n\x04mask\x18\x05 \x01(\x0b\x32!.google.firestore.v1.DocumentMask\"\xf3\x01\n\x15UpdateDocumentRequest\x12\x34\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\x1d.google.firestore.v1.DocumentB\x03\xe0\x41\x02\x12\x36\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32!.google.firestore.v1.DocumentMask\x12/\n\x04mask\x18\x03 \x01(\x0b\x32!.google.firestore.v1.DocumentMask\x12;\n\x10\x63urrent_document\x18\x04 \x01(\x0b\x32!.google.firestore.v1.Precondition\"g\n\x15\x44\x65leteDocumentRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12;\n\x10\x63urrent_document\x18\x02 \x01(\x0b\x32!.google.firestore.v1.Precondition\"\x99\x02\n\x18\x42\x61tchGetDocumentsRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tdocuments\x18\x02 \x03(\t\x12/\n\x04mask\x18\x03 \x01(\x0b\x32!.google.firestore.v1.DocumentMask\x12\x15\n\x0btransaction\x18\x04 \x01(\x0cH\x00\x12\x42\n\x0fnew_transaction\x18\x05 \x01(\x0b\x32\'.google.firestore.v1.TransactionOptionsH\x00\x12/\n\tread_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x16\n\x14\x63onsistency_selector\"\xac\x01\n\x19\x42\x61tchGetDocumentsResponse\x12.\n\x05\x66ound\x18\x01 \x01(\x0b\x32\x1d.google.firestore.v1.DocumentH\x00\x12\x11\n\x07missing\x18\x02 \x01(\tH\x00\x12\x13\n\x0btransaction\x18\x03 \x01(\x0c\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x08\n\x06result\"j\n\x17\x42\x65ginTransactionRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x38\n\x07options\x18\x02 \x01(\x0b\x32\'.google.firestore.v1.TransactionOptions\"/\n\x18\x42\x65ginTransactionResponse\x12\x13\n\x0btransaction\x18\x01 \x01(\x0c\"g\n\rCommitRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12*\n\x06writes\x18\x02 \x03(\x0b\x32\x1a.google.firestore.v1.Write\x12\x13\n\x0btransaction\x18\x03 \x01(\x0c\"z\n\x0e\x43ommitResponse\x12\x37\n\rwrite_results\x18\x01 \x03(\x0b\x32 .google.firestore.v1.WriteResult\x12/\n\x0b\x63ommit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"B\n\x0fRollbackRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0btransaction\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\"\xdd\x02\n\x0fRunQueryRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12@\n\x10structured_query\x18\x02 \x01(\x0b\x32$.google.firestore.v1.StructuredQueryH\x00\x12\x15\n\x0btransaction\x18\x05 \x01(\x0cH\x01\x12\x42\n\x0fnew_transaction\x18\x06 \x01(\x0b\x32\'.google.firestore.v1.TransactionOptionsH\x01\x12/\n\tread_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12\x41\n\x0f\x65xplain_options\x18\n \x01(\x0b\x32#.google.firestore.v1.ExplainOptionsB\x03\xe0\x41\x01\x42\x0c\n\nquery_typeB\x16\n\x14\x63onsistency_selector\"\x87\x02\n\x10RunQueryResponse\x12\x13\n\x0btransaction\x18\x02 \x01(\x0c\x12/\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\x1d.google.firestore.v1.Document\x12-\n\tread_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fskipped_results\x18\x04 \x01(\x05\x12\x0e\n\x04\x64one\x18\x06 \x01(\x08H\x00\x12<\n\x0f\x65xplain_metrics\x18\x0b \x01(\x0b\x32#.google.firestore.v1.ExplainMetricsB\x17\n\x15\x63ontinuation_selector\"\xac\x02\n\x16\x45xecutePipelineRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x46\n\x13structured_pipeline\x18\x02 \x01(\x0b\x32\'.google.firestore.v1.StructuredPipelineH\x00\x12\x15\n\x0btransaction\x18\x05 \x01(\x0cH\x01\x12\x42\n\x0fnew_transaction\x18\x06 \x01(\x0b\x32\'.google.firestore.v1.TransactionOptionsH\x01\x12/\n\tread_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x42\x0f\n\rpipeline_typeB\x16\n\x14\x63onsistency_selector\"\xcc\x01\n\x17\x45xecutePipelineResponse\x12\x13\n\x0btransaction\x18\x01 \x01(\x0c\x12.\n\x07results\x18\x02 \x03(\x0b\x32\x1d.google.firestore.v1.Document\x12\x32\n\x0e\x65xecution_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\rexplain_stats\x18\x04 \x01(\x0b\x32!.google.firestore.v1.ExplainStats\"\xff\x02\n\x1aRunAggregationQueryRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12W\n\x1cstructured_aggregation_query\x18\x02 \x01(\x0b\x32/.google.firestore.v1.StructuredAggregationQueryH\x00\x12\x15\n\x0btransaction\x18\x04 \x01(\x0cH\x01\x12\x42\n\x0fnew_transaction\x18\x05 \x01(\x0b\x32\'.google.firestore.v1.TransactionOptionsH\x01\x12/\n\tread_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12\x41\n\x0f\x65xplain_options\x18\x08 \x01(\x0b\x32#.google.firestore.v1.ExplainOptionsB\x03\xe0\x41\x01\x42\x0c\n\nquery_typeB\x16\n\x14\x63onsistency_selector\"\xd7\x01\n\x1bRunAggregationQueryResponse\x12\x36\n\x06result\x18\x01 \x01(\x0b\x32&.google.firestore.v1.AggregationResult\x12\x13\n\x0btransaction\x18\x02 \x01(\x0c\x12-\n\tread_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x0f\x65xplain_metrics\x18\n \x01(\x0b\x32#.google.firestore.v1.ExplainMetrics\"\x85\x02\n\x15PartitionQueryRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12@\n\x10structured_query\x18\x02 \x01(\x0b\x32$.google.firestore.v1.StructuredQueryH\x00\x12\x17\n\x0fpartition_count\x18\x03 \x01(\x03\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x11\n\tpage_size\x18\x05 \x01(\x05\x12/\n\tread_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x42\x0c\n\nquery_typeB\x16\n\x14\x63onsistency_selector\"b\n\x16PartitionQueryResponse\x12/\n\npartitions\x18\x01 \x03(\x0b\x32\x1b.google.firestore.v1.Cursor\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xe8\x01\n\x0cWriteRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tstream_id\x18\x02 \x01(\t\x12*\n\x06writes\x18\x03 \x03(\x0b\x32\x1a.google.firestore.v1.Write\x12\x14\n\x0cstream_token\x18\x04 \x01(\x0c\x12=\n\x06labels\x18\x05 \x03(\x0b\x32-.google.firestore.v1.WriteRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xa2\x01\n\rWriteResponse\x12\x11\n\tstream_id\x18\x01 \x01(\t\x12\x14\n\x0cstream_token\x18\x02 \x01(\x0c\x12\x37\n\rwrite_results\x18\x03 \x03(\x0b\x32 .google.firestore.v1.WriteResult\x12/\n\x0b\x63ommit_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xf2\x01\n\rListenRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x31\n\nadd_target\x18\x02 \x01(\x0b\x32\x1b.google.firestore.v1.TargetH\x00\x12\x17\n\rremove_target\x18\x03 \x01(\x05H\x00\x12>\n\x06labels\x18\x04 \x03(\x0b\x32..google.firestore.v1.ListenRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x0f\n\rtarget_change\"\xd5\x02\n\x0eListenResponse\x12:\n\rtarget_change\x18\x02 \x01(\x0b\x32!.google.firestore.v1.TargetChangeH\x00\x12>\n\x0f\x64ocument_change\x18\x03 \x01(\x0b\x32#.google.firestore.v1.DocumentChangeH\x00\x12>\n\x0f\x64ocument_delete\x18\x04 \x01(\x0b\x32#.google.firestore.v1.DocumentDeleteH\x00\x12>\n\x0f\x64ocument_remove\x18\x06 \x01(\x0b\x32#.google.firestore.v1.DocumentRemoveH\x00\x12\x36\n\x06\x66ilter\x18\x05 \x01(\x0b\x32$.google.firestore.v1.ExistenceFilterH\x00\x42\x0f\n\rresponse_type\"\xd6\x03\n\x06Target\x12\x38\n\x05query\x18\x02 \x01(\x0b\x32\'.google.firestore.v1.Target.QueryTargetH\x00\x12@\n\tdocuments\x18\x03 \x01(\x0b\x32+.google.firestore.v1.Target.DocumentsTargetH\x00\x12\x16\n\x0cresume_token\x18\x04 \x01(\x0cH\x01\x12/\n\tread_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12\x11\n\ttarget_id\x18\x05 \x01(\x05\x12\x0c\n\x04once\x18\x06 \x01(\x08\x12\x33\n\x0e\x65xpected_count\x18\x0c \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x1a$\n\x0f\x44ocumentsTarget\x12\x11\n\tdocuments\x18\x02 \x03(\t\x1am\n\x0bQueryTarget\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12@\n\x10structured_query\x18\x02 \x01(\x0b\x32$.google.firestore.v1.StructuredQueryH\x00\x42\x0c\n\nquery_typeB\r\n\x0btarget_typeB\r\n\x0bresume_type\"\xaa\x02\n\x0cTargetChange\x12N\n\x12target_change_type\x18\x01 \x01(\x0e\x32\x32.google.firestore.v1.TargetChange.TargetChangeType\x12\x12\n\ntarget_ids\x18\x02 \x03(\x05\x12!\n\x05\x63\x61use\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12\x14\n\x0cresume_token\x18\x04 \x01(\x0c\x12-\n\tread_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"N\n\x10TargetChangeType\x12\r\n\tNO_CHANGE\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x12\x0b\n\x07\x43URRENT\x10\x03\x12\t\n\x05RESET\x10\x04\"\x9f\x01\n\x18ListCollectionIdsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12/\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x16\n\x14\x63onsistency_selector\"L\n\x19ListCollectionIdsResponse\x12\x16\n\x0e\x63ollection_ids\x18\x01 \x03(\t\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xc9\x01\n\x11\x42\x61tchWriteRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12*\n\x06writes\x18\x02 \x03(\x0b\x32\x1a.google.firestore.v1.Write\x12\x42\n\x06labels\x18\x03 \x03(\x0b\x32\x32.google.firestore.v1.BatchWriteRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"q\n\x12\x42\x61tchWriteResponse\x12\x37\n\rwrite_results\x18\x01 \x03(\x0b\x32 .google.firestore.v1.WriteResult\x12\"\n\x06status\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status2\xfb\x1b\n\tFirestore\x12\x8f\x01\n\x0bGetDocument\x12\'.google.firestore.v1.GetDocumentRequest\x1a\x1d.google.firestore.v1.Document\"8\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{name=projects/*/databases/*/documents/*/**}\x12\xf5\x01\n\rListDocuments\x12).google.firestore.v1.ListDocumentsRequest\x1a*.google.firestore.v1.ListDocumentsResponse\"\x8c\x01\x82\xd3\xe4\x93\x02\x85\x01\x12\x42/v1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}Z?\x12=/v1/{parent=projects/*/databases/*/documents}/{collection_id}\x12\xbf\x01\n\x0eUpdateDocument\x12*.google.firestore.v1.UpdateDocumentRequest\x1a\x1d.google.firestore.v1.Document\"b\xda\x41\x14\x64ocument,update_mask\x82\xd3\xe4\x93\x02\x45\x32\x39/v1/{document.name=projects/*/databases/*/documents/*/**}:\x08\x64ocument\x12\x95\x01\n\x0e\x44\x65leteDocument\x12*.google.firestore.v1.DeleteDocumentRequest\x1a\x16.google.protobuf.Empty\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32*0/v1/{name=projects/*/databases/*/documents/*/**}\x12\xb9\x01\n\x11\x42\x61tchGetDocuments\x12-.google.firestore.v1.BatchGetDocumentsRequest\x1a..google.firestore.v1.BatchGetDocumentsResponse\"C\x82\xd3\xe4\x93\x02=\"8/v1/{database=projects/*/databases/*}/documents:batchGet:\x01*0\x01\x12\xc7\x01\n\x10\x42\x65ginTransaction\x12,.google.firestore.v1.BeginTransactionRequest\x1a-.google.firestore.v1.BeginTransactionResponse\"V\xda\x41\x08\x64\x61tabase\x82\xd3\xe4\x93\x02\x45\"@/v1/{database=projects/*/databases/*}/documents:beginTransaction:\x01*\x12\xa6\x01\n\x06\x43ommit\x12\".google.firestore.v1.CommitRequest\x1a#.google.firestore.v1.CommitResponse\"S\xda\x41\x0f\x64\x61tabase,writes\x82\xd3\xe4\x93\x02;\"6/v1/{database=projects/*/databases/*}/documents:commit:\x01*\x12\xa4\x01\n\x08Rollback\x12$.google.firestore.v1.RollbackRequest\x1a\x16.google.protobuf.Empty\"Z\xda\x41\x14\x64\x61tabase,transaction\x82\xd3\xe4\x93\x02=\"8/v1/{database=projects/*/databases/*}/documents:rollback:\x01*\x12\xdf\x01\n\x08RunQuery\x12$.google.firestore.v1.RunQueryRequest\x1a%.google.firestore.v1.RunQueryResponse\"\x83\x01\x82\xd3\xe4\x93\x02}\"6/v1/{parent=projects/*/databases/*/documents}:runQuery:\x01*Z@\";/v1/{parent=projects/*/databases/*/documents/*/**}:runQuery:\x01*0\x01\x12\x9e\x02\n\x0f\x45xecutePipeline\x12+.google.firestore.v1.ExecutePipelineRequest\x1a,.google.firestore.v1.ExecutePipelineResponse\"\xad\x01\x82\xd3\xe4\x93\x02\x44\"?/v1/{database=projects/*/databases/*}/documents:executePipeline:\x01*\x8a\xd3\xe4\x93\x02]\x12&\n\x08\x64\x61tabase\x12\x1aprojects/{project_id=*}/**\x12\x33\n\x08\x64\x61tabase\x12\'projects/*/databases/{database_id=*}/**0\x01\x12\x97\x02\n\x13RunAggregationQuery\x12/.google.firestore.v1.RunAggregationQueryRequest\x1a\x30.google.firestore.v1.RunAggregationQueryResponse\"\x9a\x01\x82\xd3\xe4\x93\x02\x93\x01\"A/v1/{parent=projects/*/databases/*/documents}:runAggregationQuery:\x01*ZK\"F/v1/{parent=projects/*/databases/*/documents/*/**}:runAggregationQuery:\x01*0\x01\x12\xfc\x01\n\x0ePartitionQuery\x12*.google.firestore.v1.PartitionQueryRequest\x1a+.google.firestore.v1.PartitionQueryResponse\"\x90\x01\x82\xd3\xe4\x93\x02\x89\x01\"] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/routing.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/routing.rb deleted file mode 100644 index d777329024e7..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/api/routing.rb +++ /dev/null @@ -1,459 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Specifies the routing information that should be sent along with the request - # in the form of routing header. - # **NOTE:** All service configuration rules follow the "last one wins" order. - # - # The examples below will apply to an RPC which has the following request type: - # - # Message Definition: - # - # message Request { - # // The name of the Table - # // Values can be of the following formats: - # // - `projects//tables/
` - # // - `projects//instances//tables/
` - # // - `region//zones//tables/
` - # string table_name = 1; - # - # // This value specifies routing for replication. - # // It can be in the following formats: - # // - `profiles/` - # // - a legacy `profile_id` that can be any string - # string app_profile_id = 2; - # } - # - # Example message: - # - # { - # table_name: projects/proj_foo/instances/instance_bar/table/table_baz, - # app_profile_id: profiles/prof_qux - # } - # - # The routing header consists of one or multiple key-value pairs. Every key - # and value must be percent-encoded, and joined together in the format of - # `key1=value1&key2=value2`. - # The examples below skip the percent-encoding for readability. - # - # Example 1 - # - # Extracting a field from the request to put into the routing header - # unchanged, with the key equal to the field name. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `app_profile_id`. - # routing_parameters { - # field: "app_profile_id" - # } - # }; - # - # result: - # - # x-goog-request-params: app_profile_id=profiles/prof_qux - # - # Example 2 - # - # Extracting a field from the request to put into the routing header - # unchanged, with the key different from the field name. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `app_profile_id`, but name it `routing_id` in the header. - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # }; - # - # result: - # - # x-goog-request-params: routing_id=profiles/prof_qux - # - # Example 3 - # - # Extracting a field from the request to put into the routing - # header, while matching a path template syntax on the field's value. - # - # NB: it is more useful to send nothing than to send garbage for the purpose - # of dynamic routing, since garbage pollutes cache. Thus the matching. - # - # Sub-example 3a - # - # The field matches the template. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `table_name`, if it's well-formed (with project-based - # // syntax). - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=projects/*/instances/*/**}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # table_name=projects/proj_foo/instances/instance_bar/table/table_baz - # - # Sub-example 3b - # - # The field does not match the template. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `table_name`, if it's well-formed (with region-based - # // syntax). - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=regions/*/zones/*/**}" - # } - # }; - # - # result: - # - # - # - # Sub-example 3c - # - # Multiple alternative conflictingly named path templates are - # specified. The one that matches is used to construct the header. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `table_name`, if it's well-formed, whether - # // using the region- or projects-based syntax. - # - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=regions/*/zones/*/**}" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=projects/*/instances/*/**}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # table_name=projects/proj_foo/instances/instance_bar/table/table_baz - # - # Example 4 - # - # Extracting a single routing header key-value pair by matching a - # template syntax on (a part of) a single request field. - # - # annotation: - # - # option (google.api.routing) = { - # // Take just the project id from the `table_name` field. - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # }; - # - # result: - # - # x-goog-request-params: routing_id=projects/proj_foo - # - # Example 5 - # - # Extracting a single routing header key-value pair by matching - # several conflictingly named path templates on (parts of) a single request - # field. The last template to match "wins" the conflict. - # - # annotation: - # - # option (google.api.routing) = { - # // If the `table_name` does not have instances information, - # // take just the project id for routing. - # // Otherwise take project + instance. - # - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*/instances/*}/**" - # } - # }; - # - # result: - # - # x-goog-request-params: - # routing_id=projects/proj_foo/instances/instance_bar - # - # Example 6 - # - # Extracting multiple routing header key-value pairs by matching - # several non-conflicting path templates on (parts of) a single request field. - # - # Sub-example 6a - # - # Make the templates strict, so that if the `table_name` does not - # have an instance information, nothing is sent. - # - # annotation: - # - # option (google.api.routing) = { - # // The routing code needs two keys instead of one composite - # // but works only for the tables with the "project-instance" name - # // syntax. - # - # routing_parameters { - # field: "table_name" - # path_template: "{project_id=projects/*}/instances/*/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "projects/*/{instance_id=instances/*}/**" - # } - # }; - # - # result: - # - # x-goog-request-params: - # project_id=projects/proj_foo&instance_id=instances/instance_bar - # - # Sub-example 6b - # - # Make the templates loose, so that if the `table_name` does not - # have an instance information, just the project id part is sent. - # - # annotation: - # - # option (google.api.routing) = { - # // The routing code wants two keys instead of one composite - # // but will work with just the `project_id` for tables without - # // an instance in the `table_name`. - # - # routing_parameters { - # field: "table_name" - # path_template: "{project_id=projects/*}/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "projects/*/{instance_id=instances/*}/**" - # } - # }; - # - # result (is the same as 6a for our example message because it has the instance - # information): - # - # x-goog-request-params: - # project_id=projects/proj_foo&instance_id=instances/instance_bar - # - # Example 7 - # - # Extracting multiple routing header key-value pairs by matching - # several path templates on multiple request fields. - # - # NB: note that here there is no way to specify sending nothing if one of the - # fields does not match its template. E.g. if the `table_name` is in the wrong - # format, the `project_id` will not be sent, but the `routing_id` will be. - # The backend routing code has to be aware of that and be prepared to not - # receive a full complement of keys if it expects multiple. - # - # annotation: - # - # option (google.api.routing) = { - # // The routing needs both `project_id` and `routing_id` - # // (from the `app_profile_id` field) for routing. - # - # routing_parameters { - # field: "table_name" - # path_template: "{project_id=projects/*}/**" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # project_id=projects/proj_foo&routing_id=profiles/prof_qux - # - # Example 8 - # - # Extracting a single routing header key-value pair by matching - # several conflictingly named path templates on several request fields. The - # last template to match "wins" the conflict. - # - # annotation: - # - # option (google.api.routing) = { - # // The `routing_id` can be a project id or a region id depending on - # // the table name format, but only if the `app_profile_id` is not set. - # // If `app_profile_id` is set it should be used instead. - # - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=regions/*}/**" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # }; - # - # result: - # - # x-goog-request-params: routing_id=profiles/prof_qux - # - # Example 9 - # - # Bringing it all together. - # - # annotation: - # - # option (google.api.routing) = { - # // For routing both `table_location` and a `routing_id` are needed. - # // - # // table_location can be either an instance id or a region+zone id. - # // - # // For `routing_id`, take the value of `app_profile_id` - # // - If it's in the format `profiles/`, send - # // just the `` part. - # // - If it's any other literal, send it as is. - # // If the `app_profile_id` is empty, and the `table_name` starts with - # // the project_id, send that instead. - # - # routing_parameters { - # field: "table_name" - # path_template: "projects/*/{table_location=instances/*}/tables/*" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{table_location=regions/*/zones/*}/tables/*" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "profiles/{routing_id=*}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # table_location=instances/instance_bar&routing_id=prof_qux - # @!attribute [rw] routing_parameters - # @return [::Array<::Google::Api::RoutingParameter>] - # A collection of Routing Parameter specifications. - # **NOTE:** If multiple Routing Parameters describe the same key - # (via the `path_template` field or via the `field` field when - # `path_template` is not provided), "last one wins" rule - # determines which Parameter gets used. - # See the examples for more details. - class RoutingRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A projection from an input message to the GRPC or REST header. - # @!attribute [rw] field - # @return [::String] - # A request field to extract the header key-value pair from. - # @!attribute [rw] path_template - # @return [::String] - # A pattern matching the key-value field. Optional. - # If not specified, the whole field specified in the `field` field will be - # taken as value, and its name used as key. If specified, it MUST contain - # exactly one named segment (along with any number of unnamed segments) The - # pattern will be matched over the field specified in the `field` field, then - # if the match is successful: - # - the name of the single named segment will be used as a header name, - # - the match value of the segment will be used as a header value; - # if the match is NOT successful, nothing will be sent. - # - # Example: - # - # -- This is a field in the request message - # | that the header value will be extracted from. - # | - # | -- This is the key name in the - # | | routing header. - # V | - # field: "table_name" v - # path_template: "projects/*/{table_location=instances/*}/tables/*" - # ^ ^ - # | | - # In the {} brackets is the pattern that -- | - # specifies what to extract from the | - # field as a value to be sent. | - # | - # The string in the field must match the whole pattern -- - # before brackets, inside brackets, after brackets. - # - # When looking at this specific example, we can see that: - # - A key-value pair with the key `table_location` - # and the value matching `instances/*` should be added - # to the x-goog-request-params routing header. - # - The value is extracted from the request message's `table_name` field - # if it matches the full pattern specified: - # `projects/*/instances/*/tables/*`. - # - # **NB:** If the `path_template` field is not provided, the key name is - # equal to the field name, and the whole field should be sent as a value. - # This makes the pattern for the field and the value functionally equivalent - # to `**`, and the configuration - # - # { - # field: "table_name" - # } - # - # is a functionally equivalent shorthand to: - # - # { - # field: "table_name" - # path_template: "{table_name=**}" - # } - # - # See Example 1 for more details. - class RoutingParameter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/aggregation_result.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/aggregation_result.rb deleted file mode 100644 index cbb83ff369da..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/aggregation_result.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Firestore - module V1 - # The result of a single bucket from a Firestore aggregation query. - # - # The keys of `aggregate_fields` are the same for all results in an aggregation - # query, unlike document queries which can have different fields present for - # each result. - # @!attribute [rw] aggregate_fields - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}] - # The result of the aggregation functions, ex: `COUNT(*) AS total_docs`. - # - # The key is the - # {::Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation#alias alias} - # assigned to the aggregation function on input and the size of this map - # equals the number of aggregation functions in the query. - class AggregationResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Firestore::V1::Value] - class AggregateFieldsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/bloom_filter.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/bloom_filter.rb deleted file mode 100644 index dd4118168b2c..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/bloom_filter.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Firestore - module V1 - # A sequence of bits, encoded in a byte array. - # - # Each byte in the `bitmap` byte array stores 8 bits of the sequence. The only - # exception is the last byte, which may store 8 _or fewer_ bits. The `padding` - # defines the number of bits of the last byte to be ignored as "padding". The - # values of these "padding" bits are unspecified and must be ignored. - # - # To retrieve the first bit, bit 0, calculate: `(bitmap[0] & 0x01) != 0`. - # To retrieve the second bit, bit 1, calculate: `(bitmap[0] & 0x02) != 0`. - # To retrieve the third bit, bit 2, calculate: `(bitmap[0] & 0x04) != 0`. - # To retrieve the fourth bit, bit 3, calculate: `(bitmap[0] & 0x08) != 0`. - # To retrieve bit n, calculate: `(bitmap[n / 8] & (0x01 << (n % 8))) != 0`. - # - # The "size" of a `BitSequence` (the number of bits it contains) is calculated - # by this formula: `(bitmap.length * 8) - padding`. - # @!attribute [rw] bitmap - # @return [::String] - # The bytes that encode the bit sequence. - # May have a length of zero. - # @!attribute [rw] padding - # @return [::Integer] - # The number of bits of the last byte in `bitmap` to ignore as "padding". - # If the length of `bitmap` is zero, then this value must be `0`. - # Otherwise, this value must be between 0 and 7, inclusive. - class BitSequence - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A bloom filter (https://en.wikipedia.org/wiki/Bloom_filter). - # - # The bloom filter hashes the entries with MD5 and treats the resulting 128-bit - # hash as 2 distinct 64-bit hash values, interpreted as unsigned integers - # using 2's complement encoding. - # - # These two hash values, named `h1` and `h2`, are then used to compute the - # `hash_count` hash values using the formula, starting at `i=0`: - # - # h(i) = h1 + (i * h2) - # - # These resulting values are then taken modulo the number of bits in the bloom - # filter to get the bits of the bloom filter to test for the given entry. - # @!attribute [rw] bits - # @return [::Google::Cloud::Firestore::V1::BitSequence] - # The bloom filter data. - # @!attribute [rw] hash_count - # @return [::Integer] - # The number of hashes used by the algorithm. - class BloomFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/common.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/common.rb deleted file mode 100644 index aa8ef8a9180c..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/common.rb +++ /dev/null @@ -1,101 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Firestore - module V1 - # A set of field paths on a document. - # Used to restrict a get or update operation on a document to a subset of its - # fields. - # This is different from standard field masks, as this is always scoped to a - # {::Google::Cloud::Firestore::V1::Document Document}, and takes in account the dynamic - # nature of {::Google::Cloud::Firestore::V1::Value Value}. - # @!attribute [rw] field_paths - # @return [::Array<::String>] - # The list of field paths in the mask. See - # {::Google::Cloud::Firestore::V1::Document#fields Document.fields} for a field path - # syntax reference. - class DocumentMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A precondition on a document, used for conditional operations. - # @!attribute [rw] exists - # @return [::Boolean] - # When set to `true`, the target document must exist. - # When set to `false`, the target document must not exist. - # - # Note: The following fields are mutually exclusive: `exists`, `update_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # When set, the target document must exist and have been last updated at - # that time. Timestamp must be microsecond aligned. - # - # Note: The following fields are mutually exclusive: `update_time`, `exists`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Precondition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options for creating a new transaction. - # @!attribute [rw] read_only - # @return [::Google::Cloud::Firestore::V1::TransactionOptions::ReadOnly] - # The transaction can only be used for read operations. - # - # Note: The following fields are mutually exclusive: `read_only`, `read_write`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] read_write - # @return [::Google::Cloud::Firestore::V1::TransactionOptions::ReadWrite] - # The transaction can be used for both read and write operations. - # - # Note: The following fields are mutually exclusive: `read_write`, `read_only`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class TransactionOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Options for a transaction that can be used to read and write documents. - # - # Firestore does not allow 3rd party auth requests to create read-write. - # transactions. - # @!attribute [rw] retry_transaction - # @return [::String] - # An optional transaction to retry. - class ReadWrite - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options for a transaction that can only be used to read documents. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Reads documents at the given time. - # - # This must be a microsecond precision timestamp within the past one - # hour, or if Point-in-Time Recovery is enabled, can additionally be a - # whole minute timestamp within the past 7 days. - class ReadOnly - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/document.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/document.rb deleted file mode 100644 index f20a2a991b11..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/document.rb +++ /dev/null @@ -1,326 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Firestore - module V1 - # A Firestore document. - # - # Must not exceed 1 MiB - 4 bytes. - # @!attribute [rw] name - # @return [::String] - # The resource name of the document, for example - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # @!attribute [rw] fields - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}] - # The document's fields. - # - # The map keys represent field names. - # - # Field names matching the regular expression `__.*__` are reserved. Reserved - # field names are forbidden except in certain documented contexts. The field - # names, represented as UTF-8, must not exceed 1,500 bytes and cannot be - # empty. - # - # Field paths may be used in other contexts to refer to structured fields - # defined here. For `map_value`, the field path is represented by a - # dot-delimited (`.`) string of segments. Each segment is either a simple - # field name (defined below) or a quoted field name. For example, the - # structured field `"foo" : { map_value: { "x&y" : { string_value: "hello" - # }}}` would be represented by the field path `` foo.`x&y` ``. - # - # A simple field name contains only characters `a` to `z`, `A` to `Z`, - # `0` to `9`, or `_`, and must not start with `0` to `9`. For example, - # `foo_bar_17`. - # - # A quoted field name starts and ends with `` ` `` and - # may contain any character. Some characters, including `` ` ``, must be - # escaped using a `\`. For example, `` `x&y` `` represents `x&y` and - # `` `bak\`tik` `` represents `` bak`tik ``. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the document was created. - # - # This value increases monotonically when a document is deleted then - # recreated. It can also be compared to values from other documents and - # the `read_time` of a query. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the document was last changed. - # - # This value is initially set to the `create_time` then increases - # monotonically with each change to the document. It can also be - # compared to values from other documents and the `read_time` of a query. - class Document - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Firestore::V1::Value] - class FieldsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A message that can hold any of the supported value types. - # @!attribute [rw] null_value - # @return [::Google::Protobuf::NullValue] - # A null value. - # - # Note: The following fields are mutually exclusive: `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] boolean_value - # @return [::Boolean] - # A boolean value. - # - # Note: The following fields are mutually exclusive: `boolean_value`, `null_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] integer_value - # @return [::Integer] - # An integer value. - # - # Note: The following fields are mutually exclusive: `integer_value`, `null_value`, `boolean_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] double_value - # @return [::Float] - # A double value. - # - # Note: The following fields are mutually exclusive: `double_value`, `null_value`, `boolean_value`, `integer_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] timestamp_value - # @return [::Google::Protobuf::Timestamp] - # A timestamp value. - # - # Precise only to microseconds. When stored, any additional precision is - # rounded down. - # - # Note: The following fields are mutually exclusive: `timestamp_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] string_value - # @return [::String] - # A string value. - # - # The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. - # Only the first 1,500 bytes of the UTF-8 representation are considered by - # queries. - # - # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bytes_value - # @return [::String] - # A bytes value. - # - # Must not exceed 1 MiB - 89 bytes. - # Only the first 1,500 bytes are considered by queries. - # - # Note: The following fields are mutually exclusive: `bytes_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] reference_value - # @return [::String] - # A reference to a document. For example: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # - # Note: The following fields are mutually exclusive: `reference_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] geo_point_value - # @return [::Google::Type::LatLng] - # A geo point value representing a point on the surface of Earth. - # - # Note: The following fields are mutually exclusive: `geo_point_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] array_value - # @return [::Google::Cloud::Firestore::V1::ArrayValue] - # An array value. - # - # Cannot directly contain another array value, though can contain a - # map which contains another array. - # - # Note: The following fields are mutually exclusive: `array_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] map_value - # @return [::Google::Cloud::Firestore::V1::MapValue] - # A map value. - # - # Note: The following fields are mutually exclusive: `map_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `field_reference_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] field_reference_value - # @return [::String] - # Value which references a field. - # - # This is considered relative (vs absolute) since it only refers to a field - # and not a field within a particular document. - # - # **Requires:** - # - # * Must follow [field reference][FieldReference.field_path] limitations. - # - # * Not allowed to be used when writing documents. - # - # Note: The following fields are mutually exclusive: `field_reference_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `variable_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] variable_reference_value - # @return [::String] - # Pointer to a variable defined elsewhere in a pipeline. - # - # Unlike `field_reference_value` which references a field within a - # document, this refers to a variable, defined in a separate namespace than - # the fields of a document. - # - # Note: The following fields are mutually exclusive: `variable_reference_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `function_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] function_value - # @return [::Google::Cloud::Firestore::V1::Function] - # A value that represents an unevaluated expression. - # - # **Requires:** - # - # * Not allowed to be used when writing documents. - # - # Note: The following fields are mutually exclusive: `function_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `pipeline_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] pipeline_value - # @return [::Google::Cloud::Firestore::V1::Pipeline] - # A value that represents an unevaluated pipeline. - # - # **Requires:** - # - # * Not allowed to be used when writing documents. - # - # Note: The following fields are mutually exclusive: `pipeline_value`, `null_value`, `boolean_value`, `integer_value`, `double_value`, `timestamp_value`, `string_value`, `bytes_value`, `reference_value`, `geo_point_value`, `array_value`, `map_value`, `field_reference_value`, `variable_reference_value`, `function_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An array value. - # @!attribute [rw] values - # @return [::Array<::Google::Cloud::Firestore::V1::Value>] - # Values in the array. - class ArrayValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A map value. - # @!attribute [rw] fields - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}] - # The map's fields. - # - # The map keys represent field names. Field names matching the regular - # expression `__.*__` are reserved. Reserved field names are forbidden except - # in certain documented contexts. The map keys, represented as UTF-8, must - # not exceed 1,500 bytes and cannot be empty. - class MapValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Firestore::V1::Value] - class FieldsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Represents an unevaluated scalar expression. - # - # For example, the expression `like(user_name, "%alice%")` is represented as: - # - # ``` - # name: "like" - # args { field_reference: "user_name" } - # args { string_value: "%alice%" } - # ``` - # @!attribute [rw] name - # @return [::String] - # Required. The name of the function to evaluate. - # - # **Requires:** - # - # * must be in snake case (lower case with underscore separator). - # @!attribute [rw] args - # @return [::Array<::Google::Cloud::Firestore::V1::Value>] - # Optional. Ordered list of arguments the given function expects. - # @!attribute [rw] options - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}] - # Optional. Optional named arguments that certain functions may support. - class Function - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Firestore::V1::Value] - class OptionsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A Firestore query represented as an ordered list of operations / stages. - # @!attribute [rw] stages - # @return [::Array<::Google::Cloud::Firestore::V1::Pipeline::Stage>] - # Required. Ordered list of stages to evaluate. - class Pipeline - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A single operation within a pipeline. - # - # A stage is made up of a unique name, and a list of arguments. The exact - # number of arguments & types is dependent on the stage type. - # - # To give an example, the stage `filter(state = "MD")` would be encoded as: - # - # ``` - # name: "filter" - # args { - # function_value { - # name: "eq" - # args { field_reference_value: "state" } - # args { string_value: "MD" } - # } - # } - # ``` - # - # See public documentation for the full list. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the stage to evaluate. - # - # **Requires:** - # - # * must be in snake case (lower case with underscore separator). - # @!attribute [rw] args - # @return [::Array<::Google::Cloud::Firestore::V1::Value>] - # Optional. Ordered list of arguments the given stage expects. - # @!attribute [rw] options - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}] - # Optional. Optional named arguments that certain functions may support. - class Stage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Firestore::V1::Value] - class OptionsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/explain_stats.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/explain_stats.rb deleted file mode 100644 index 1ef7dad15f8c..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/explain_stats.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Firestore - module V1 - # Pipeline explain stats. - # - # Depending on the explain options in the original request, this can contain - # the optimized plan and / or execution stats. - # @!attribute [rw] data - # @return [::Google::Protobuf::Any] - # The format depends on the `output_format` options in the request. - # - # Currently there are two supported options: `TEXT` and `JSON`. - # Both supply a `google.protobuf.StringValue`. - class ExplainStats - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/firestore.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/firestore.rb deleted file mode 100644 index a070482dd304..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/firestore.rb +++ /dev/null @@ -1,1110 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Firestore - module V1 - # The request for - # {::Google::Cloud::Firestore::V1::Firestore::Client#get_document Firestore.GetDocument}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Document to get. In the format: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # @!attribute [rw] mask - # @return [::Google::Cloud::Firestore::V1::DocumentMask] - # The fields to return. If not set, returns all fields. - # - # If the document has a field that is not present in this mask, that field - # will not be returned in the response. - # @!attribute [rw] transaction - # @return [::String] - # Reads the document in a transaction. - # - # Note: The following fields are mutually exclusive: `transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Reads the version of the document at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following fields are mutually exclusive: `read_time`, `transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class GetDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::V1::Firestore::Client#list_documents Firestore.ListDocuments}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name. In the format: - # `projects/{project_id}/databases/{database_id}/documents` or - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # - # For example: - # `projects/my-project/databases/my-database/documents` or - # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - # @!attribute [rw] collection_id - # @return [::String] - # Optional. The collection ID, relative to `parent`, to list. - # - # For example: `chatrooms` or `messages`. - # - # This is optional, and when not provided, Firestore will list documents - # from all collections under the provided `parent`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of documents to return in a single response. - # - # Firestore may return fewer than this value. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous `ListDocuments` response. - # - # Provide this to retrieve the subsequent page. When paginating, all other - # parameters (with the exception of `page_size`) must match the values set - # in the request that generated the page token. - # @!attribute [rw] order_by - # @return [::String] - # Optional. The optional ordering of the documents to return. - # - # For example: `priority desc, __name__ desc`. - # - # This mirrors the {::Google::Cloud::Firestore::V1::StructuredQuery#order_by `ORDER BY`} - # used in Firestore queries but in a string representation. When absent, - # documents are ordered based on `__name__ ASC`. - # @!attribute [rw] mask - # @return [::Google::Cloud::Firestore::V1::DocumentMask] - # Optional. The fields to return. If not set, returns all fields. - # - # If a document has a field that is not present in this mask, that field - # will not be returned in the response. - # @!attribute [rw] transaction - # @return [::String] - # Perform the read as part of an already active transaction. - # - # Note: The following fields are mutually exclusive: `transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Perform the read at the provided time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following fields are mutually exclusive: `read_time`, `transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] show_missing - # @return [::Boolean] - # If the list should show missing documents. - # - # A document is missing if it does not exist, but there are sub-documents - # nested underneath it. When true, such missing documents will be returned - # with a key but will not have fields, - # {::Google::Cloud::Firestore::V1::Document#create_time `create_time`}, or - # {::Google::Cloud::Firestore::V1::Document#update_time `update_time`} set. - # - # Requests with `show_missing` may not specify `where` or `order_by`. - class ListDocumentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Firestore::V1::Firestore::Client#list_documents Firestore.ListDocuments}. - # @!attribute [rw] documents - # @return [::Array<::Google::Cloud::Firestore::V1::Document>] - # The Documents found. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of documents. - # - # If this field is omitted, there are no subsequent pages. - class ListDocumentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::V1::Firestore::Client#create_document Firestore.CreateDocument}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource. For example: - # `projects/{project_id}/databases/{database_id}/documents` or - # `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` - # @!attribute [rw] collection_id - # @return [::String] - # Required. The collection ID, relative to `parent`, to list. For example: - # `chatrooms`. - # @!attribute [rw] document_id - # @return [::String] - # The client-assigned document ID to use for this document. - # - # Optional. If not specified, an ID will be assigned by the service. - # @!attribute [rw] document - # @return [::Google::Cloud::Firestore::V1::Document] - # Required. The document to create. `name` must not be set. - # @!attribute [rw] mask - # @return [::Google::Cloud::Firestore::V1::DocumentMask] - # The fields to return. If not set, returns all fields. - # - # If the document has a field that is not present in this mask, that field - # will not be returned in the response. - class CreateDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::V1::Firestore::Client#update_document Firestore.UpdateDocument}. - # @!attribute [rw] document - # @return [::Google::Cloud::Firestore::V1::Document] - # Required. The updated document. - # Creates the document if it does not already exist. - # @!attribute [rw] update_mask - # @return [::Google::Cloud::Firestore::V1::DocumentMask] - # The fields to update. - # None of the field paths in the mask may contain a reserved name. - # - # If the document exists on the server and has fields not referenced in the - # mask, they are left unchanged. - # Fields referenced in the mask, but not present in the input document, are - # deleted from the document on the server. - # @!attribute [rw] mask - # @return [::Google::Cloud::Firestore::V1::DocumentMask] - # The fields to return. If not set, returns all fields. - # - # If the document has a field that is not present in this mask, that field - # will not be returned in the response. - # @!attribute [rw] current_document - # @return [::Google::Cloud::Firestore::V1::Precondition] - # An optional precondition on the document. - # The request will fail if this is set and not met by the target document. - class UpdateDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::V1::Firestore::Client#delete_document Firestore.DeleteDocument}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Document to delete. In the format: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # @!attribute [rw] current_document - # @return [::Google::Cloud::Firestore::V1::Precondition] - # An optional precondition on the document. - # The request will fail if this is set and not met by the target document. - class DeleteDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::V1::Firestore::Client#batch_get_documents Firestore.BatchGetDocuments}. - # @!attribute [rw] database - # @return [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @!attribute [rw] documents - # @return [::Array<::String>] - # The names of the documents to retrieve. In the format: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # The request will fail if any of the document is not a child resource of the - # given `database`. Duplicate names will be elided. - # @!attribute [rw] mask - # @return [::Google::Cloud::Firestore::V1::DocumentMask] - # The fields to return. If not set, returns all fields. - # - # If a document has a field that is not present in this mask, that field will - # not be returned in the response. - # @!attribute [rw] transaction - # @return [::String] - # Reads documents in a transaction. - # - # Note: The following fields are mutually exclusive: `transaction`, `new_transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] new_transaction - # @return [::Google::Cloud::Firestore::V1::TransactionOptions] - # Starts a new transaction and reads the documents. - # Defaults to a read-only transaction. - # The new transaction ID will be returned as the first response in the - # stream. - # - # Note: The following fields are mutually exclusive: `new_transaction`, `transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Reads documents as they were at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following fields are mutually exclusive: `read_time`, `transaction`, `new_transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class BatchGetDocumentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The streamed response for - # {::Google::Cloud::Firestore::V1::Firestore::Client#batch_get_documents Firestore.BatchGetDocuments}. - # @!attribute [rw] found - # @return [::Google::Cloud::Firestore::V1::Document] - # A document that was requested. - # - # Note: The following fields are mutually exclusive: `found`, `missing`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] missing - # @return [::String] - # A document name that was requested but does not exist. In the format: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # - # Note: The following fields are mutually exclusive: `missing`, `found`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] transaction - # @return [::String] - # The transaction that was started as part of this request. - # Will only be set in the first response, and only if - # {::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest#new_transaction BatchGetDocumentsRequest.new_transaction} - # was set in the request. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the document was read. - # This may be monotically increasing, in this case the previous documents in - # the result stream are guaranteed not to have changed between their - # read_time and this one. - class BatchGetDocumentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::V1::Firestore::Client#begin_transaction Firestore.BeginTransaction}. - # @!attribute [rw] database - # @return [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @!attribute [rw] options - # @return [::Google::Cloud::Firestore::V1::TransactionOptions] - # The options for the transaction. - # Defaults to a read-write transaction. - class BeginTransactionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Firestore::V1::Firestore::Client#begin_transaction Firestore.BeginTransaction}. - # @!attribute [rw] transaction - # @return [::String] - # The transaction that was started. - class BeginTransactionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Firestore::V1::Firestore::Client#commit Firestore.Commit}. - # @!attribute [rw] database - # @return [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @!attribute [rw] writes - # @return [::Array<::Google::Cloud::Firestore::V1::Write>] - # The writes to apply. - # - # Always executed atomically and in order. - # @!attribute [rw] transaction - # @return [::String] - # If set, applies all writes in this transaction, and commits it. - class CommitRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for {::Google::Cloud::Firestore::V1::Firestore::Client#commit Firestore.Commit}. - # @!attribute [rw] write_results - # @return [::Array<::Google::Cloud::Firestore::V1::WriteResult>] - # The result of applying the writes. - # - # This i-th write result corresponds to the i-th write in the - # request. - # @!attribute [rw] commit_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the commit occurred. Any read with an equal or greater - # `read_time` is guaranteed to see the effects of the commit. - class CommitResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Firestore::V1::Firestore::Client#rollback Firestore.Rollback}. - # @!attribute [rw] database - # @return [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @!attribute [rw] transaction - # @return [::String] - # Required. The transaction to roll back. - class RollbackRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Firestore::V1::Firestore::Client#run_query Firestore.RunQuery}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name. In the format: - # `projects/{project_id}/databases/{database_id}/documents` or - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # For example: - # `projects/my-project/databases/my-database/documents` or - # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - # @!attribute [rw] structured_query - # @return [::Google::Cloud::Firestore::V1::StructuredQuery] - # A structured query. - # @!attribute [rw] transaction - # @return [::String] - # Run the query within an already active transaction. - # - # The value here is the opaque transaction ID to execute the query in. - # - # Note: The following fields are mutually exclusive: `transaction`, `new_transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] new_transaction - # @return [::Google::Cloud::Firestore::V1::TransactionOptions] - # Starts a new transaction and reads the documents. - # Defaults to a read-only transaction. - # The new transaction ID will be returned as the first response in the - # stream. - # - # Note: The following fields are mutually exclusive: `new_transaction`, `transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Reads documents as they were at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following fields are mutually exclusive: `read_time`, `transaction`, `new_transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] explain_options - # @return [::Google::Cloud::Firestore::V1::ExplainOptions] - # Optional. Explain options for the query. If set, additional query - # statistics will be returned. If not, only query results will be returned. - class RunQueryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Firestore::V1::Firestore::Client#run_query Firestore.RunQuery}. - # @!attribute [rw] transaction - # @return [::String] - # The transaction that was started as part of this request. - # Can only be set in the first response, and only if - # {::Google::Cloud::Firestore::V1::RunQueryRequest#new_transaction RunQueryRequest.new_transaction} - # was set in the request. If set, no other fields will be set in this - # response. - # @!attribute [rw] document - # @return [::Google::Cloud::Firestore::V1::Document] - # A query result, not set when reporting partial progress. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the document was read. This may be monotonically - # increasing; in this case, the previous documents in the result stream are - # guaranteed not to have changed between their `read_time` and this one. - # - # If the query returns no results, a response with `read_time` and no - # `document` will be sent, and this represents the time at which the query - # was run. - # @!attribute [rw] skipped_results - # @return [::Integer] - # The number of results that have been skipped due to an offset between - # the last response and the current response. - # @!attribute [rw] done - # @return [::Boolean] - # If present, Firestore has completely finished the request and no more - # documents will be returned. - # @!attribute [rw] explain_metrics - # @return [::Google::Cloud::Firestore::V1::ExplainMetrics] - # Query explain metrics. This is only present when the - # {::Google::Cloud::Firestore::V1::RunQueryRequest#explain_options RunQueryRequest.explain_options} - # is provided, and it is sent only once with the last response in the stream. - class RunQueryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::V1::Firestore::Client#execute_pipeline Firestore.ExecutePipeline}. - # @!attribute [rw] database - # @return [::String] - # Required. Database identifier, in the form - # `projects/{project}/databases/{database}`. - # @!attribute [rw] structured_pipeline - # @return [::Google::Cloud::Firestore::V1::StructuredPipeline] - # A pipelined operation. - # @!attribute [rw] transaction - # @return [::String] - # Run the query within an already active transaction. - # - # The value here is the opaque transaction ID to execute the query in. - # - # Note: The following fields are mutually exclusive: `transaction`, `new_transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] new_transaction - # @return [::Google::Cloud::Firestore::V1::TransactionOptions] - # Execute the pipeline in a new transaction. - # - # The identifier of the newly created transaction will be returned in the - # first response on the stream. This defaults to a read-only transaction. - # - # Note: The following fields are mutually exclusive: `new_transaction`, `transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Execute the pipeline in a snapshot transaction at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following fields are mutually exclusive: `read_time`, `transaction`, `new_transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ExecutePipelineRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for [Firestore.Execute][]. - # @!attribute [rw] transaction - # @return [::String] - # Newly created transaction identifier. - # - # This field is only specified as part of the first response from the server, - # alongside the `results` field when the original request specified - # [ExecuteRequest.new_transaction][]. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Firestore::V1::Document>] - # An ordered batch of results returned executing a pipeline. - # - # The batch size is variable, and can even be zero for when only a partial - # progress message is returned. - # - # The fields present in the returned documents are only those that were - # explicitly requested in the pipeline, this includes those like - # {::Google::Cloud::Firestore::V1::Document#name `__name__`} and - # {::Google::Cloud::Firestore::V1::Document#update_time `__update_time__`}. This is - # explicitly a divergence from `Firestore.RunQuery` / `Firestore.GetDocument` - # RPCs which always return such fields even when they are not specified in - # the {::Google::Cloud::Firestore::V1::DocumentMask `mask`}. - # @!attribute [rw] execution_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the results are valid. - # - # This is a (not strictly) monotonically increasing value across multiple - # responses in the same stream. The API guarantees that all previously - # returned results are still valid at the latest `execution_time`. This - # allows the API consumer to treat the query if it ran at the latest - # `execution_time` returned. - # - # If the query returns no results, a response with `execution_time` and no - # `results` will be sent, and this represents the time at which the operation - # was run. - # @!attribute [rw] explain_stats - # @return [::Google::Cloud::Firestore::V1::ExplainStats] - # Query explain stats. - # - # This is present on the **last** response if the request configured explain - # to run in 'analyze' or 'explain' mode in the pipeline options. If the query - # does not return any results, a response with `explain_stats` and no - # `results` will still be sent. - class ExecutePipelineResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::V1::Firestore::Client#run_aggregation_query Firestore.RunAggregationQuery}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name. In the format: - # `projects/{project_id}/databases/{database_id}/documents` or - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # For example: - # `projects/my-project/databases/my-database/documents` or - # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - # @!attribute [rw] structured_aggregation_query - # @return [::Google::Cloud::Firestore::V1::StructuredAggregationQuery] - # An aggregation query. - # @!attribute [rw] transaction - # @return [::String] - # Run the aggregation within an already active transaction. - # - # The value here is the opaque transaction ID to execute the query in. - # - # Note: The following fields are mutually exclusive: `transaction`, `new_transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] new_transaction - # @return [::Google::Cloud::Firestore::V1::TransactionOptions] - # Starts a new transaction as part of the query, defaulting to read-only. - # - # The new transaction ID will be returned as the first response in the - # stream. - # - # Note: The following fields are mutually exclusive: `new_transaction`, `transaction`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Executes the query at the given timestamp. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - # - # Note: The following fields are mutually exclusive: `read_time`, `transaction`, `new_transaction`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] explain_options - # @return [::Google::Cloud::Firestore::V1::ExplainOptions] - # Optional. Explain options for the query. If set, additional query - # statistics will be returned. If not, only query results will be returned. - class RunAggregationQueryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Firestore::V1::Firestore::Client#run_aggregation_query Firestore.RunAggregationQuery}. - # @!attribute [rw] result - # @return [::Google::Cloud::Firestore::V1::AggregationResult] - # A single aggregation result. - # - # Not present when reporting partial progress. - # @!attribute [rw] transaction - # @return [::String] - # The transaction that was started as part of this request. - # - # Only present on the first response when the request requested to start - # a new transaction. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the aggregate result was computed. This is always - # monotonically increasing; in this case, the previous AggregationResult in - # the result stream are guaranteed not to have changed between their - # `read_time` and this one. - # - # If the query returns no results, a response with `read_time` and no - # `result` will be sent, and this represents the time at which the query - # was run. - # @!attribute [rw] explain_metrics - # @return [::Google::Cloud::Firestore::V1::ExplainMetrics] - # Query explain metrics. This is only present when the - # {::Google::Cloud::Firestore::V1::RunAggregationQueryRequest#explain_options RunAggregationQueryRequest.explain_options} - # is provided, and it is sent only once with the last response in the stream. - class RunAggregationQueryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::V1::Firestore::Client#partition_query Firestore.PartitionQuery}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name. In the format: - # `projects/{project_id}/databases/{database_id}/documents`. - # Document resource names are not supported; only database resource names - # can be specified. - # @!attribute [rw] structured_query - # @return [::Google::Cloud::Firestore::V1::StructuredQuery] - # A structured query. - # Query must specify collection with all descendants and be ordered by name - # ascending. Other filters, order bys, limits, offsets, and start/end - # cursors are not supported. - # @!attribute [rw] partition_count - # @return [::Integer] - # The desired maximum number of partition points. - # The partitions may be returned across multiple pages of results. - # The number must be positive. The actual number of partitions - # returned may be fewer. - # - # For example, this may be set to one fewer than the number of parallel - # queries to be run, or in running a data pipeline job, one fewer than the - # number of workers or compute instances available. - # @!attribute [rw] page_token - # @return [::String] - # The `next_page_token` value returned from a previous call to - # PartitionQuery that may be used to get an additional set of results. - # There are no ordering guarantees between sets of results. Thus, using - # multiple sets of results will require merging the different result sets. - # - # For example, two subsequent calls using a page_token may return: - # - # * cursor B, cursor M, cursor Q - # * cursor A, cursor U, cursor W - # - # To obtain a complete result set ordered with respect to the results of the - # query supplied to PartitionQuery, the results sets should be merged: - # cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of partitions to return in this call, subject to - # `partition_count`. - # - # For example, if `partition_count` = 10 and `page_size` = 8, the first call - # to PartitionQuery will return up to 8 partitions and a `next_page_token` - # if more results exist. A second call to PartitionQuery will return up to - # 2 partitions, to complete the total of 10 specified in `partition_count`. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Reads documents as they were at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - class PartitionQueryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Firestore::V1::Firestore::Client#partition_query Firestore.PartitionQuery}. - # @!attribute [rw] partitions - # @return [::Array<::Google::Cloud::Firestore::V1::Cursor>] - # Partition results. - # Each partition is a split point that can be used by RunQuery as a starting - # or end point for the query results. The RunQuery requests must be made with - # the same query supplied to this PartitionQuery request. The partition - # cursors will be ordered according to same ordering as the results of the - # query supplied to PartitionQuery. - # - # For example, if a PartitionQuery request returns partition cursors A and B, - # running the following three queries will return the entire result set of - # the original query: - # - # * query, end_at A - # * query, start_at A, end_at B - # * query, start_at B - # - # An empty result may indicate that the query has too few results to be - # partitioned, or that the query is not yet supported for partitioning. - # @!attribute [rw] next_page_token - # @return [::String] - # A page token that may be used to request an additional set of results, up - # to the number specified by `partition_count` in the PartitionQuery request. - # If blank, there are no more results. - class PartitionQueryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Firestore::V1::Firestore::Client#write Firestore.Write}. - # - # The first request creates a stream, or resumes an existing one from a token. - # - # When creating a new stream, the server replies with a response containing - # only an ID and a token, to use in the next request. - # - # When resuming a stream, the server first streams any responses later than the - # given token, then a response containing only an up-to-date token, to use in - # the next request. - # @!attribute [rw] database - # @return [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # This is only required in the first message. - # @!attribute [rw] stream_id - # @return [::String] - # The ID of the write stream to resume. - # This may only be set in the first message. When left empty, a new write - # stream will be created. - # @!attribute [rw] writes - # @return [::Array<::Google::Cloud::Firestore::V1::Write>] - # The writes to apply. - # - # Always executed atomically and in order. - # This must be empty on the first request. - # This may be empty on the last request. - # This must not be empty on all other requests. - # @!attribute [rw] stream_token - # @return [::String] - # A stream token that was previously sent by the server. - # - # The client should set this field to the token from the most recent - # {::Google::Cloud::Firestore::V1::WriteResponse WriteResponse} it has received. This - # acknowledges that the client has received responses up to this token. After - # sending this token, earlier tokens may not be used anymore. - # - # The server may close the stream if there are too many unacknowledged - # responses. - # - # Leave this field unset when creating a new stream. To resume a stream at - # a specific point, set this field and the `stream_id` field. - # - # Leave this field unset when creating a new stream. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels associated with this write request. - class WriteRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The response for {::Google::Cloud::Firestore::V1::Firestore::Client#write Firestore.Write}. - # @!attribute [rw] stream_id - # @return [::String] - # The ID of the stream. - # Only set on the first message, when a new stream was created. - # @!attribute [rw] stream_token - # @return [::String] - # A token that represents the position of this response in the stream. - # This can be used by a client to resume the stream at this point. - # - # This field is always set. - # @!attribute [rw] write_results - # @return [::Array<::Google::Cloud::Firestore::V1::WriteResult>] - # The result of applying the writes. - # - # This i-th write result corresponds to the i-th write in the - # request. - # @!attribute [rw] commit_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the commit occurred. Any read with an equal or greater - # `read_time` is guaranteed to see the effects of the write. - class WriteResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request for {::Google::Cloud::Firestore::V1::Firestore::Client#listen Firestore.Listen} - # @!attribute [rw] database - # @return [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @!attribute [rw] add_target - # @return [::Google::Cloud::Firestore::V1::Target] - # A target to add to this stream. - # - # Note: The following fields are mutually exclusive: `add_target`, `remove_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] remove_target - # @return [::Integer] - # The ID of a target to remove from this stream. - # - # Note: The following fields are mutually exclusive: `remove_target`, `add_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels associated with this target change. - class ListenRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The response for {::Google::Cloud::Firestore::V1::Firestore::Client#listen Firestore.Listen}. - # @!attribute [rw] target_change - # @return [::Google::Cloud::Firestore::V1::TargetChange] - # Targets have changed. - # - # Note: The following fields are mutually exclusive: `target_change`, `document_change`, `document_delete`, `document_remove`, `filter`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] document_change - # @return [::Google::Cloud::Firestore::V1::DocumentChange] - # A {::Google::Cloud::Firestore::V1::Document Document} has changed. - # - # Note: The following fields are mutually exclusive: `document_change`, `target_change`, `document_delete`, `document_remove`, `filter`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] document_delete - # @return [::Google::Cloud::Firestore::V1::DocumentDelete] - # A {::Google::Cloud::Firestore::V1::Document Document} has been deleted. - # - # Note: The following fields are mutually exclusive: `document_delete`, `target_change`, `document_change`, `document_remove`, `filter`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] document_remove - # @return [::Google::Cloud::Firestore::V1::DocumentRemove] - # A {::Google::Cloud::Firestore::V1::Document Document} has been removed from a target - # (because it is no longer relevant to that target). - # - # Note: The following fields are mutually exclusive: `document_remove`, `target_change`, `document_change`, `document_delete`, `filter`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] filter - # @return [::Google::Cloud::Firestore::V1::ExistenceFilter] - # A filter to apply to the set of documents previously returned for the - # given target. - # - # Returned when documents may have been removed from the given target, but - # the exact documents are unknown. - # - # Note: The following fields are mutually exclusive: `filter`, `target_change`, `document_change`, `document_delete`, `document_remove`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ListenResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A specification of a set of documents to listen to. - # @!attribute [rw] query - # @return [::Google::Cloud::Firestore::V1::Target::QueryTarget] - # A target specified by a query. - # - # Note: The following fields are mutually exclusive: `query`, `documents`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] documents - # @return [::Google::Cloud::Firestore::V1::Target::DocumentsTarget] - # A target specified by a set of document names. - # - # Note: The following fields are mutually exclusive: `documents`, `query`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] resume_token - # @return [::String] - # A resume token from a prior - # {::Google::Cloud::Firestore::V1::TargetChange TargetChange} for an identical target. - # - # Using a resume token with a different target is unsupported and may fail. - # - # Note: The following fields are mutually exclusive: `resume_token`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Start listening after a specific `read_time`. - # - # The client must know the state of matching documents at this time. - # - # Note: The following fields are mutually exclusive: `read_time`, `resume_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] target_id - # @return [::Integer] - # The target ID that identifies the target on the stream. Must be a positive - # number and non-zero. - # - # If `target_id` is 0 (or unspecified), the server will assign an ID for this - # target and return that in a `TargetChange::ADD` event. Once a target with - # `target_id=0` is added, all subsequent targets must also have - # `target_id=0`. If an `AddTarget` request with `target_id != 0` is - # sent to the server after a target with `target_id=0` is added, the server - # will immediately send a response with a `TargetChange::Remove` event. - # - # Note that if the client sends multiple `AddTarget` requests - # without an ID, the order of IDs returned in `TargetChange.target_ids` are - # undefined. Therefore, clients should provide a target ID instead of relying - # on the server to assign one. - # - # If `target_id` is non-zero, there must not be an existing active target on - # this stream with the same ID. - # @!attribute [rw] once - # @return [::Boolean] - # If the target should be removed once it is current and consistent. - # @!attribute [rw] expected_count - # @return [::Google::Protobuf::Int32Value] - # The number of documents that last matched the query at the resume token or - # read time. - # - # This value is only relevant when a `resume_type` is provided. This value - # being present and greater than zero signals that the client wants - # `ExistenceFilter.unchanged_names` to be included in the response. - class Target - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A target specified by a set of documents names. - # @!attribute [rw] documents - # @return [::Array<::String>] - # The names of the documents to retrieve. In the format: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # The request will fail if any of the document is not a child resource of - # the given `database`. Duplicate names will be elided. - class DocumentsTarget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A target specified by a query. - # @!attribute [rw] parent - # @return [::String] - # The parent resource name. In the format: - # `projects/{project_id}/databases/{database_id}/documents` or - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # For example: - # `projects/my-project/databases/my-database/documents` or - # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - # @!attribute [rw] structured_query - # @return [::Google::Cloud::Firestore::V1::StructuredQuery] - # A structured query. - class QueryTarget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Targets being watched have changed. - # @!attribute [rw] target_change_type - # @return [::Google::Cloud::Firestore::V1::TargetChange::TargetChangeType] - # The type of change that occurred. - # @!attribute [rw] target_ids - # @return [::Array<::Integer>] - # The target IDs of targets that have changed. - # - # If empty, the change applies to all targets. - # - # The order of the target IDs is not defined. - # @!attribute [rw] cause - # @return [::Google::Rpc::Status] - # The error that resulted in this change, if applicable. - # @!attribute [rw] resume_token - # @return [::String] - # A token that can be used to resume the stream for the given `target_ids`, - # or all targets if `target_ids` is empty. - # - # Not set on every target change. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # The consistent `read_time` for the given `target_ids` (omitted when the - # target_ids are not at a consistent snapshot). - # - # The stream is guaranteed to send a `read_time` with `target_ids` empty - # whenever the entire stream reaches a new consistent snapshot. ADD, - # CURRENT, and RESET messages are guaranteed to (eventually) result in a - # new consistent snapshot (while NO_CHANGE and REMOVE messages are not). - # - # For a given stream, `read_time` is guaranteed to be monotonically - # increasing. - class TargetChange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of change. - module TargetChangeType - # No change has occurred. Used only to send an updated `resume_token`. - NO_CHANGE = 0 - - # The targets have been added. - ADD = 1 - - # The targets have been removed. - REMOVE = 2 - - # The targets reflect all changes committed before the targets were added - # to the stream. - # - # This will be sent after or with a `read_time` that is greater than or - # equal to the time at which the targets were added. - # - # Listeners can wait for this change if read-after-write semantics - # are desired. - CURRENT = 3 - - # The targets have been reset, and a new initial state for the targets - # will be returned in subsequent changes. - # - # After the initial state is complete, `CURRENT` will be returned even - # if the target was previously indicated to be `CURRENT`. - RESET = 4 - end - end - - # The request for - # {::Google::Cloud::Firestore::V1::Firestore::Client#list_collection_ids Firestore.ListCollectionIds}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent document. In the format: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # For example: - # `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return. - # @!attribute [rw] page_token - # @return [::String] - # A page token. Must be a value from - # {::Google::Cloud::Firestore::V1::ListCollectionIdsResponse ListCollectionIdsResponse}. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Reads documents as they were at the given time. - # - # This must be a microsecond precision timestamp within the past one hour, - # or if Point-in-Time Recovery is enabled, can additionally be a whole - # minute timestamp within the past 7 days. - class ListCollectionIdsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response from - # {::Google::Cloud::Firestore::V1::Firestore::Client#list_collection_ids Firestore.ListCollectionIds}. - # @!attribute [rw] collection_ids - # @return [::Array<::String>] - # The collection ids. - # @!attribute [rw] next_page_token - # @return [::String] - # A page token that may be used to continue the list. - class ListCollectionIdsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Firestore::V1::Firestore::Client#batch_write Firestore.BatchWrite}. - # @!attribute [rw] database - # @return [::String] - # Required. The database name. In the format: - # `projects/{project_id}/databases/{database_id}`. - # @!attribute [rw] writes - # @return [::Array<::Google::Cloud::Firestore::V1::Write>] - # The writes to apply. - # - # Method does not apply writes atomically and does not guarantee ordering. - # Each write succeeds or fails independently. You cannot write to the same - # document more than once per request. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels associated with this batch write. - class BatchWriteRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The response from - # {::Google::Cloud::Firestore::V1::Firestore::Client#batch_write Firestore.BatchWrite}. - # @!attribute [rw] write_results - # @return [::Array<::Google::Cloud::Firestore::V1::WriteResult>] - # The result of applying the writes. - # - # This i-th write result corresponds to the i-th write in the - # request. - # @!attribute [rw] status - # @return [::Array<::Google::Rpc::Status>] - # The status of applying the writes. - # - # This i-th write status corresponds to the i-th write in the - # request. - class BatchWriteResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/pipeline.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/pipeline.rb deleted file mode 100644 index f46ac594fed8..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/pipeline.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Firestore - module V1 - # A Firestore query represented as an ordered list of operations / stages. - # - # This is considered the top-level function which plans and executes a query. - # It is logically equivalent to `query(stages, options)`, but prevents the - # client from having to build a function wrapper. - # @!attribute [rw] pipeline - # @return [::Google::Cloud::Firestore::V1::Pipeline] - # Required. The pipeline query to execute. - # @!attribute [rw] options - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}] - # Optional. Optional query-level arguments. - class StructuredPipeline - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Firestore::V1::Value] - class OptionsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query.rb deleted file mode 100644 index 88beb633529b..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query.rb +++ /dev/null @@ -1,629 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Firestore - module V1 - # A Firestore query. - # - # The query stages are executed in the following order: - # 1. from - # 2. where - # 3. select - # 4. order_by + start_at + end_at - # 5. offset - # 6. limit - # 7. find_nearest - # @!attribute [rw] select - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::Projection] - # Optional sub-set of the fields to return. - # - # This acts as a {::Google::Cloud::Firestore::V1::DocumentMask DocumentMask} over the - # documents returned from a query. When not set, assumes that the caller - # wants all fields returned. - # @!attribute [rw] from - # @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::CollectionSelector>] - # The collections to query. - # @!attribute [rw] where - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::Filter] - # The filter to apply. - # @!attribute [rw] order_by - # @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::Order>] - # The order to apply to the query results. - # - # Firestore allows callers to provide a full ordering, a partial ordering, or - # no ordering at all. In all cases, Firestore guarantees a stable ordering - # through the following rules: - # - # * The `order_by` is required to reference all fields used with an - # inequality filter. - # * All fields that are required to be in the `order_by` but are not already - # present are appended in lexicographical ordering of the field name. - # * If an order on `__name__` is not specified, it is appended by default. - # - # Fields are appended with the same sort direction as the last order - # specified, or 'ASCENDING' if no order was specified. For example: - # - # * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` - # * `ORDER BY a DESC` becomes `ORDER BY a DESC, __name__ DESC` - # * `WHERE a > 1` becomes `WHERE a > 1 ORDER BY a ASC, __name__ ASC` - # * `WHERE __name__ > ... AND a > 1` becomes - # `WHERE __name__ > ... AND a > 1 ORDER BY a ASC, __name__ ASC` - # @!attribute [rw] start_at - # @return [::Google::Cloud::Firestore::V1::Cursor] - # A potential prefix of a position in the result set to start the query at. - # - # The ordering of the result set is based on the `ORDER BY` clause of the - # original query. - # - # ``` - # SELECT * FROM k WHERE a = 1 AND b > 2 ORDER BY b ASC, __name__ ASC; - # ``` - # - # This query's results are ordered by `(b ASC, __name__ ASC)`. - # - # Cursors can reference either the full ordering or a prefix of the location, - # though it cannot reference more fields than what are in the provided - # `ORDER BY`. - # - # Continuing off the example above, attaching the following start cursors - # will have varying impact: - # - # - `START BEFORE (2, /k/123)`: start the query right before `a = 1 AND - # b > 2 AND __name__ > /k/123`. - # - `START AFTER (10)`: start the query right after `a = 1 AND b > 10`. - # - # Unlike `OFFSET` which requires scanning over the first N results to skip, - # a start cursor allows the query to begin at a logical position. This - # position is not required to match an actual result, it will scan forward - # from this position to find the next document. - # - # Requires: - # - # * The number of values cannot be greater than the number of fields - # specified in the `ORDER BY` clause. - # @!attribute [rw] end_at - # @return [::Google::Cloud::Firestore::V1::Cursor] - # A potential prefix of a position in the result set to end the query at. - # - # This is similar to `START_AT` but with it controlling the end position - # rather than the start position. - # - # Requires: - # - # * The number of values cannot be greater than the number of fields - # specified in the `ORDER BY` clause. - # @!attribute [rw] offset - # @return [::Integer] - # The number of documents to skip before returning the first result. - # - # This applies after the constraints specified by the `WHERE`, `START AT`, & - # `END AT` but before the `LIMIT` clause. - # - # Requires: - # - # * The value must be greater than or equal to zero if specified. - # @!attribute [rw] limit - # @return [::Google::Protobuf::Int32Value] - # The maximum number of results to return. - # - # Applies after all other constraints. - # - # Requires: - # - # * The value must be greater than or equal to zero if specified. - # @!attribute [rw] find_nearest - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FindNearest] - # Optional. A potential nearest neighbors search. - # - # Applies after all other filters and ordering. - # - # Finds the closest vector embeddings to the given query vector. - class StructuredQuery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A selection of a collection, such as `messages as m1`. - # @!attribute [rw] collection_id - # @return [::String] - # The collection ID. - # When set, selects only collections with this ID. - # @!attribute [rw] all_descendants - # @return [::Boolean] - # When false, selects only collections that are immediate children of - # the `parent` specified in the containing `RunQueryRequest`. - # When true, selects all descendant collections. - class CollectionSelector - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A filter. - # @!attribute [rw] composite_filter - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter] - # A composite filter. - # - # Note: The following fields are mutually exclusive: `composite_filter`, `field_filter`, `unary_filter`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] field_filter - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter] - # A filter on a document field. - # - # Note: The following fields are mutually exclusive: `field_filter`, `composite_filter`, `unary_filter`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] unary_filter - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter] - # A filter that takes exactly one argument. - # - # Note: The following fields are mutually exclusive: `unary_filter`, `composite_filter`, `field_filter`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Filter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A filter that merges multiple other filters using the given operator. - # @!attribute [rw] op - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter::Operator] - # The operator for combining multiple filters. - # @!attribute [rw] filters - # @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::Filter>] - # The list of filters to combine. - # - # Requires: - # - # * At least one filter is present. - class CompositeFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A composite filter operator. - module Operator - # Unspecified. This value must not be used. - OPERATOR_UNSPECIFIED = 0 - - # Documents are required to satisfy all of the combined filters. - AND = 1 - - # Documents are required to satisfy at least one of the combined filters. - OR = 2 - end - end - - # A filter on a specific field. - # @!attribute [rw] field - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference] - # The field to filter by. - # @!attribute [rw] op - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter::Operator] - # The operator to filter by. - # @!attribute [rw] value - # @return [::Google::Cloud::Firestore::V1::Value] - # The value to compare to. - class FieldFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A field filter operator. - module Operator - # Unspecified. This value must not be used. - OPERATOR_UNSPECIFIED = 0 - - # The given `field` is less than the given `value`. - # - # Requires: - # - # * That `field` come first in `order_by`. - LESS_THAN = 1 - - # The given `field` is less than or equal to the given `value`. - # - # Requires: - # - # * That `field` come first in `order_by`. - LESS_THAN_OR_EQUAL = 2 - - # The given `field` is greater than the given `value`. - # - # Requires: - # - # * That `field` come first in `order_by`. - GREATER_THAN = 3 - - # The given `field` is greater than or equal to the given `value`. - # - # Requires: - # - # * That `field` come first in `order_by`. - GREATER_THAN_OR_EQUAL = 4 - - # The given `field` is equal to the given `value`. - EQUAL = 5 - - # The given `field` is not equal to the given `value`. - # - # Requires: - # - # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`. - # * That `field` comes first in the `order_by`. - NOT_EQUAL = 6 - - # The given `field` is an array that contains the given `value`. - ARRAY_CONTAINS = 7 - - # The given `field` is equal to at least one value in the given array. - # - # Requires: - # - # * That `value` is a non-empty `ArrayValue`, subject to disjunction - # limits. - # * No `NOT_IN` filters in the same query. - IN = 8 - - # The given `field` is an array that contains any of the values in the - # given array. - # - # Requires: - # - # * That `value` is a non-empty `ArrayValue`, subject to disjunction - # limits. - # * No other `ARRAY_CONTAINS_ANY` filters within the same disjunction. - # * No `NOT_IN` filters in the same query. - ARRAY_CONTAINS_ANY = 9 - - # The value of the `field` is not in the given array. - # - # Requires: - # - # * That `value` is a non-empty `ArrayValue` with at most 10 values. - # * No other `OR`, `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`, `NOT_EQUAL`, - # `IS_NOT_NULL`, or `IS_NOT_NAN`. - # * That `field` comes first in the `order_by`. - NOT_IN = 10 - end - end - - # A filter with a single operand. - # @!attribute [rw] op - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter::Operator] - # The unary operator to apply. - # @!attribute [rw] field - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference] - # The field to which to apply the operator. - class UnaryFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A unary operator. - module Operator - # Unspecified. This value must not be used. - OPERATOR_UNSPECIFIED = 0 - - # The given `field` is equal to `NaN`. - IS_NAN = 2 - - # The given `field` is equal to `NULL`. - IS_NULL = 3 - - # The given `field` is not equal to `NaN`. - # - # Requires: - # - # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`. - # * That `field` comes first in the `order_by`. - IS_NOT_NAN = 4 - - # The given `field` is not equal to `NULL`. - # - # Requires: - # - # * A single `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`. - # * That `field` comes first in the `order_by`. - IS_NOT_NULL = 5 - end - end - - # An order on a field. - # @!attribute [rw] field - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference] - # The field to order by. - # @!attribute [rw] direction - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::Direction] - # The direction to order by. Defaults to `ASCENDING`. - class Order - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A reference to a field in a document, ex: `stats.operations`. - # @!attribute [rw] field_path - # @return [::String] - # A reference to a field in a document. - # - # Requires: - # - # * MUST be a dot-delimited (`.`) string of segments, where each segment - # conforms to {::Google::Cloud::Firestore::V1::Document#fields document field name} - # limitations. - class FieldReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The projection of document's fields to return. - # @!attribute [rw] fields - # @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference>] - # The fields to return. - # - # If empty, all fields are returned. To only return the name - # of the document, use `['__name__']`. - class Projection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Nearest Neighbors search config. The ordering provided by FindNearest - # supersedes the order_by stage. If multiple documents have the same vector - # distance, the returned document order is not guaranteed to be stable - # between queries. - # @!attribute [rw] vector_field - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference] - # Required. An indexed vector field to search upon. Only documents which - # contain vectors whose dimensionality match the query_vector can be - # returned. - # @!attribute [rw] query_vector - # @return [::Google::Cloud::Firestore::V1::Value] - # Required. The query vector that we are searching on. Must be a vector of - # no more than 2048 dimensions. - # @!attribute [rw] distance_measure - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FindNearest::DistanceMeasure] - # Required. The distance measure to use, required. - # @!attribute [rw] limit - # @return [::Google::Protobuf::Int32Value] - # Required. The number of nearest neighbors to return. Must be a positive - # integer of no more than 1000. - # @!attribute [rw] distance_result_field - # @return [::String] - # Optional. Optional name of the field to output the result of the vector - # distance calculation. Must conform to [document field - # name][google.firestore.v1.Document.fields] limitations. - # @!attribute [rw] distance_threshold - # @return [::Google::Protobuf::DoubleValue] - # Optional. Option to specify a threshold for which no less similar - # documents will be returned. The behavior of the specified - # `distance_measure` will affect the meaning of the distance threshold. - # Since DOT_PRODUCT distances increase when the vectors are more similar, - # the comparison is inverted. - # - # * For EUCLIDEAN, COSINE: `WHERE distance <= distance_threshold` - # * For DOT_PRODUCT: `WHERE distance >= distance_threshold` - class FindNearest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The distance measure to use when comparing vectors. - module DistanceMeasure - # Should not be set. - DISTANCE_MEASURE_UNSPECIFIED = 0 - - # Measures the EUCLIDEAN distance between the vectors. See - # [Euclidean](https://en.wikipedia.org/wiki/Euclidean_distance) to learn - # more. The resulting distance decreases the more similar two vectors - # are. - EUCLIDEAN = 1 - - # COSINE distance compares vectors based on the angle between them, which - # allows you to measure similarity that isn't based on the vectors - # magnitude. We recommend using DOT_PRODUCT with unit normalized vectors - # instead of COSINE distance, which is mathematically equivalent with - # better performance. See [Cosine - # Similarity](https://en.wikipedia.org/wiki/Cosine_similarity) to learn - # more about COSINE similarity and COSINE distance. The resulting - # COSINE distance decreases the more similar two vectors are. - COSINE = 2 - - # Similar to cosine but is affected by the magnitude of the vectors. See - # [Dot Product](https://en.wikipedia.org/wiki/Dot_product) to learn more. - # The resulting distance increases the more similar two vectors are. - DOT_PRODUCT = 3 - end - end - - # A sort direction. - module Direction - # Unspecified. - DIRECTION_UNSPECIFIED = 0 - - # Ascending. - ASCENDING = 1 - - # Descending. - DESCENDING = 2 - end - end - - # Firestore query for running an aggregation over a - # {::Google::Cloud::Firestore::V1::StructuredQuery StructuredQuery}. - # @!attribute [rw] structured_query - # @return [::Google::Cloud::Firestore::V1::StructuredQuery] - # Nested structured query. - # @!attribute [rw] aggregations - # @return [::Array<::Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation>] - # Optional. Series of aggregations to apply over the results of the - # `structured_query`. - # - # Requires: - # - # * A minimum of one and maximum of five aggregations per query. - class StructuredAggregationQuery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines an aggregation that produces a single result. - # @!attribute [rw] count - # @return [::Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation::Count] - # Count aggregator. - # - # Note: The following fields are mutually exclusive: `count`, `sum`, `avg`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] sum - # @return [::Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation::Sum] - # Sum aggregator. - # - # Note: The following fields are mutually exclusive: `sum`, `count`, `avg`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] avg - # @return [::Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation::Avg] - # Average aggregator. - # - # Note: The following fields are mutually exclusive: `avg`, `count`, `sum`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] alias - # @return [::String] - # Optional. Optional name of the field to store the result of the - # aggregation into. - # - # If not provided, Firestore will pick a default name following the format - # `field_`. For example: - # - # ``` - # AGGREGATE - # COUNT_UP_TO(1) AS count_up_to_1, - # COUNT_UP_TO(2), - # COUNT_UP_TO(3) AS count_up_to_3, - # COUNT(*) - # OVER ( - # ... - # ); - # ``` - # - # becomes: - # - # ``` - # AGGREGATE - # COUNT_UP_TO(1) AS count_up_to_1, - # COUNT_UP_TO(2) AS field_1, - # COUNT_UP_TO(3) AS count_up_to_3, - # COUNT(*) AS field_2 - # OVER ( - # ... - # ); - # ``` - # - # Requires: - # - # * Must be unique across all aggregation aliases. - # * Conform to {::Google::Cloud::Firestore::V1::Document#fields document field name} - # limitations. - class Aggregation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Count of documents that match the query. - # - # The `COUNT(*)` aggregation function operates on the entire document - # so it does not require a field reference. - # @!attribute [rw] up_to - # @return [::Google::Protobuf::Int64Value] - # Optional. Optional constraint on the maximum number of documents to - # count. - # - # This provides a way to set an upper bound on the number of documents - # to scan, limiting latency, and cost. - # - # Unspecified is interpreted as no bound. - # - # High-Level Example: - # - # ``` - # AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); - # ``` - # - # Requires: - # - # * Must be greater than zero when present. - class Count - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Sum of the values of the requested field. - # - # * Only numeric values will be aggregated. All non-numeric values - # including `NULL` are skipped. - # - # * If the aggregated values contain `NaN`, returns `NaN`. Infinity math - # follows IEEE-754 standards. - # - # * If the aggregated value set is empty, returns 0. - # - # * Returns a 64-bit integer if all aggregated numbers are integers and the - # sum result does not overflow. Otherwise, the result is returned as a - # double. Note that even if all the aggregated values are integers, the - # result is returned as a double if it cannot fit within a 64-bit signed - # integer. When this occurs, the returned value will lose precision. - # - # * When underflow occurs, floating-point aggregation is non-deterministic. - # This means that running the same query repeatedly without any changes to - # the underlying values could produce slightly different results each - # time. In those cases, values should be stored as integers over - # floating-point numbers. - # @!attribute [rw] field - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference] - # The field to aggregate on. - class Sum - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Average of the values of the requested field. - # - # * Only numeric values will be aggregated. All non-numeric values - # including `NULL` are skipped. - # - # * If the aggregated values contain `NaN`, returns `NaN`. Infinity math - # follows IEEE-754 standards. - # - # * If the aggregated value set is empty, returns `NULL`. - # - # * Always returns the result as a double. - # @!attribute [rw] field - # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference] - # The field to aggregate on. - class Avg - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # A position in a query result set. - # @!attribute [rw] values - # @return [::Array<::Google::Cloud::Firestore::V1::Value>] - # The values that represent a position, in the order they appear in - # the order by clause of a query. - # - # Can contain fewer values than specified in the order by clause. - # @!attribute [rw] before - # @return [::Boolean] - # If the position is just before or just after the given values, relative - # to the sort order defined by the query. - class Cursor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query_profile.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query_profile.rb deleted file mode 100644 index 2c04e4f0a820..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/query_profile.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Firestore - module V1 - # Explain options for the query. - # @!attribute [rw] analyze - # @return [::Boolean] - # Optional. Whether to execute this query. - # - # When false (the default), the query will be planned, returning only - # metrics from the planning stages. - # - # When true, the query will be planned and executed, returning the full - # query results along with both planning and execution stage metrics. - class ExplainOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Explain metrics for the query. - # @!attribute [rw] plan_summary - # @return [::Google::Cloud::Firestore::V1::PlanSummary] - # Planning phase information for the query. - # @!attribute [rw] execution_stats - # @return [::Google::Cloud::Firestore::V1::ExecutionStats] - # Aggregated stats from the execution of the query. Only present when - # {::Google::Cloud::Firestore::V1::ExplainOptions#analyze ExplainOptions.analyze} is set - # to true. - class ExplainMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Planning phase information for the query. - # @!attribute [rw] indexes_used - # @return [::Array<::Google::Protobuf::Struct>] - # The indexes selected for the query. For example: - # [ - # \\{"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, - # \\{"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} - # ] - class PlanSummary - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Execution statistics for the query. - # @!attribute [rw] results_returned - # @return [::Integer] - # Total number of results returned, including documents, projections, - # aggregation results, keys. - # @!attribute [rw] execution_duration - # @return [::Google::Protobuf::Duration] - # Total time to execute the query in the backend. - # @!attribute [rw] read_operations - # @return [::Integer] - # Total billable read operations. - # @!attribute [rw] debug_stats - # @return [::Google::Protobuf::Struct] - # Debugging statistics from the execution of the query. Note that the - # debugging stats are subject to change as Firestore evolves. It could - # include: - # { - # "indexes_entries_scanned": "1000", - # "documents_scanned": "20", - # "billing_details" : { - # "documents_billable": "20", - # "index_entries_billable": "1000", - # "min_query_cost": "0" - # } - # } - class ExecutionStats - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/write.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/write.rb deleted file mode 100644 index ee5975f34b2c..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/firestore/v1/write.rb +++ /dev/null @@ -1,317 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Firestore - module V1 - # A write on a document. - # @!attribute [rw] update - # @return [::Google::Cloud::Firestore::V1::Document] - # A document to write. - # - # Note: The following fields are mutually exclusive: `update`, `delete`, `transform`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] delete - # @return [::String] - # A document name to delete. In the format: - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # - # Note: The following fields are mutually exclusive: `delete`, `update`, `transform`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] transform - # @return [::Google::Cloud::Firestore::V1::DocumentTransform] - # Applies a transformation to a document. - # - # Note: The following fields are mutually exclusive: `transform`, `update`, `delete`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] update_mask - # @return [::Google::Cloud::Firestore::V1::DocumentMask] - # The fields to update in this write. - # - # This field can be set only when the operation is `update`. - # If the mask is not set for an `update` and the document exists, any - # existing data will be overwritten. - # If the mask is set and the document on the server has fields not covered by - # the mask, they are left unchanged. - # Fields referenced in the mask, but not present in the input document, are - # deleted from the document on the server. - # The field paths in this mask must not contain a reserved field name. - # @!attribute [rw] update_transforms - # @return [::Array<::Google::Cloud::Firestore::V1::DocumentTransform::FieldTransform>] - # The transforms to perform after update. - # - # This field can be set only when the operation is `update`. If present, this - # write is equivalent to performing `update` and `transform` to the same - # document atomically and in order. - # @!attribute [rw] current_document - # @return [::Google::Cloud::Firestore::V1::Precondition] - # An optional precondition on the document. - # - # The write will fail if this is set and not met by the target document. - class Write - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A transformation of a document. - # @!attribute [rw] document - # @return [::String] - # The name of the document to transform. - # @!attribute [rw] field_transforms - # @return [::Array<::Google::Cloud::Firestore::V1::DocumentTransform::FieldTransform>] - # The list of transformations to apply to the fields of the document, in - # order. - # This must not be empty. - class DocumentTransform - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A transformation of a field of the document. - # @!attribute [rw] field_path - # @return [::String] - # The path of the field. See - # {::Google::Cloud::Firestore::V1::Document#fields Document.fields} for the field path - # syntax reference. - # @!attribute [rw] set_to_server_value - # @return [::Google::Cloud::Firestore::V1::DocumentTransform::FieldTransform::ServerValue] - # Sets the field to the given server value. - # - # Note: The following fields are mutually exclusive: `set_to_server_value`, `increment`, `maximum`, `minimum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] increment - # @return [::Google::Cloud::Firestore::V1::Value] - # Adds the given value to the field's current value. - # - # This must be an integer or a double value. - # If the field is not an integer or double, or if the field does not yet - # exist, the transformation will set the field to the given value. - # If either of the given value or the current field value are doubles, - # both values will be interpreted as doubles. Double arithmetic and - # representation of double values follow IEEE 754 semantics. - # If there is positive/negative integer overflow, the field is resolved - # to the largest magnitude positive/negative integer. - # - # Note: The following fields are mutually exclusive: `increment`, `set_to_server_value`, `maximum`, `minimum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] maximum - # @return [::Google::Cloud::Firestore::V1::Value] - # Sets the field to the maximum of its current value and the given value. - # - # This must be an integer or a double value. - # If the field is not an integer or double, or if the field does not yet - # exist, the transformation will set the field to the given value. - # If a maximum operation is applied where the field and the input value - # are of mixed types (that is - one is an integer and one is a double) - # the field takes on the type of the larger operand. If the operands are - # equivalent (e.g. 3 and 3.0), the field does not change. - # 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and - # zero input value is always the stored value. - # The maximum of any numeric value x and NaN is NaN. - # - # Note: The following fields are mutually exclusive: `maximum`, `set_to_server_value`, `increment`, `minimum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] minimum - # @return [::Google::Cloud::Firestore::V1::Value] - # Sets the field to the minimum of its current value and the given value. - # - # This must be an integer or a double value. - # If the field is not an integer or double, or if the field does not yet - # exist, the transformation will set the field to the input value. - # If a minimum operation is applied where the field and the input value - # are of mixed types (that is - one is an integer and one is a double) - # the field takes on the type of the smaller operand. If the operands are - # equivalent (e.g. 3 and 3.0), the field does not change. - # 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and - # zero input value is always the stored value. - # The minimum of any numeric value x and NaN is NaN. - # - # Note: The following fields are mutually exclusive: `minimum`, `set_to_server_value`, `increment`, `maximum`, `append_missing_elements`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] append_missing_elements - # @return [::Google::Cloud::Firestore::V1::ArrayValue] - # Append the given elements in order if they are not already present in - # the current field value. - # If the field is not an array, or if the field does not yet exist, it is - # first set to the empty array. - # - # Equivalent numbers of different types (e.g. 3L and 3.0) are - # considered equal when checking if a value is missing. - # NaN is equal to NaN, and Null is equal to Null. - # If the input contains multiple equivalent values, only the first will - # be considered. - # - # The corresponding transform_result will be the null value. - # - # Note: The following fields are mutually exclusive: `append_missing_elements`, `set_to_server_value`, `increment`, `maximum`, `minimum`, `remove_all_from_array`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] remove_all_from_array - # @return [::Google::Cloud::Firestore::V1::ArrayValue] - # Remove all of the given elements from the array in the field. - # If the field is not an array, or if the field does not yet exist, it is - # set to the empty array. - # - # Equivalent numbers of the different types (e.g. 3L and 3.0) are - # considered equal when deciding whether an element should be removed. - # NaN is equal to NaN, and Null is equal to Null. - # This will remove all equivalent values if there are duplicates. - # - # The corresponding transform_result will be the null value. - # - # Note: The following fields are mutually exclusive: `remove_all_from_array`, `set_to_server_value`, `increment`, `maximum`, `minimum`, `append_missing_elements`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class FieldTransform - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A value that is calculated by the server. - module ServerValue - # Unspecified. This value must not be used. - SERVER_VALUE_UNSPECIFIED = 0 - - # The time at which the server processed the request, with millisecond - # precision. If used on multiple fields (same or different documents) in - # a transaction, all the fields will get the same server timestamp. - REQUEST_TIME = 1 - end - end - end - - # The result of applying a write. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The last update time of the document after applying the write. Not set - # after a `delete`. - # - # If the write did not actually change the document, this will be the - # previous update_time. - # @!attribute [rw] transform_results - # @return [::Array<::Google::Cloud::Firestore::V1::Value>] - # The results of applying each - # {::Google::Cloud::Firestore::V1::DocumentTransform::FieldTransform DocumentTransform.FieldTransform}, - # in the same order. - class WriteResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A {::Google::Cloud::Firestore::V1::Document Document} has changed. - # - # May be the result of multiple {::Google::Cloud::Firestore::V1::Write writes}, including - # deletes, that ultimately resulted in a new value for the - # {::Google::Cloud::Firestore::V1::Document Document}. - # - # Multiple {::Google::Cloud::Firestore::V1::DocumentChange DocumentChange} messages may be - # returned for the same logical change, if multiple targets are affected. - # @!attribute [rw] document - # @return [::Google::Cloud::Firestore::V1::Document] - # The new state of the {::Google::Cloud::Firestore::V1::Document Document}. - # - # If `mask` is set, contains only fields that were updated or added. - # @!attribute [rw] target_ids - # @return [::Array<::Integer>] - # A set of target IDs of targets that match this document. - # @!attribute [rw] removed_target_ids - # @return [::Array<::Integer>] - # A set of target IDs for targets that no longer match this document. - class DocumentChange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A {::Google::Cloud::Firestore::V1::Document Document} has been deleted. - # - # May be the result of multiple {::Google::Cloud::Firestore::V1::Write writes}, including - # updates, the last of which deleted the - # {::Google::Cloud::Firestore::V1::Document Document}. - # - # Multiple {::Google::Cloud::Firestore::V1::DocumentDelete DocumentDelete} messages may be - # returned for the same logical delete, if multiple targets are affected. - # @!attribute [rw] document - # @return [::String] - # The resource name of the {::Google::Cloud::Firestore::V1::Document Document} that was - # deleted. - # @!attribute [rw] removed_target_ids - # @return [::Array<::Integer>] - # A set of target IDs for targets that previously matched this entity. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # The read timestamp at which the delete was observed. - # - # Greater or equal to the `commit_time` of the delete. - class DocumentDelete - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A {::Google::Cloud::Firestore::V1::Document Document} has been removed from the view of - # the targets. - # - # Sent if the document is no longer relevant to a target and is out of view. - # Can be sent instead of a DocumentDelete or a DocumentChange if the server - # can not send the new value of the document. - # - # Multiple {::Google::Cloud::Firestore::V1::DocumentRemove DocumentRemove} messages may be - # returned for the same logical write or delete, if multiple targets are - # affected. - # @!attribute [rw] document - # @return [::String] - # The resource name of the {::Google::Cloud::Firestore::V1::Document Document} that has - # gone out of view. - # @!attribute [rw] removed_target_ids - # @return [::Array<::Integer>] - # A set of target IDs for targets that previously matched this document. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # The read timestamp at which the remove was observed. - # - # Greater or equal to the `commit_time` of the change/delete/remove. - class DocumentRemove - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A digest of all the documents that match a given target. - # @!attribute [rw] target_id - # @return [::Integer] - # The target ID to which this filter applies. - # @!attribute [rw] count - # @return [::Integer] - # The total count of documents that match - # {::Google::Cloud::Firestore::V1::ExistenceFilter#target_id target_id}. - # - # If different from the count of documents in the client that match, the - # client must manually determine which documents no longer match the target. - # - # The client can use the `unchanged_names` bloom filter to assist with - # this determination by testing ALL the document names against the filter; - # if the document name is NOT in the filter, it means the document no - # longer matches the target. - # @!attribute [rw] unchanged_names - # @return [::Google::Cloud::Firestore::V1::BloomFilter] - # A bloom filter that, despite its name, contains the UTF-8 byte encodings of - # the resource names of ALL the documents that match - # {::Google::Cloud::Firestore::V1::ExistenceFilter#target_id target_id}, in the form - # `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - # - # This bloom filter may be omitted at the server's discretion, such as if it - # is deemed that the client will not make use of it or if it is too - # computationally expensive to calculate or transmit. Clients must gracefully - # handle this field being absent by falling back to the logic used before - # this field existed; that is, re-add the target without a resume token to - # figure out which documents in the client's cache are out of sync. - class ExistenceFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/struct.rb +++ /dev/null @@ -1,108 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Struct` represents a structured data value, consisting of fields - # which map to dynamically typed values. In some languages, `Struct` - # might be supported by a native representation. For example, in - # scripting languages like JS a struct is represented as an - # object. The details of that representation are described together - # with the proto support for the language. - # - # The JSON representation for `Struct` is JSON object. - # @!attribute [rw] fields - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Unordered map of dynamically typed values. - class Struct - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class FieldsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `Value` represents a dynamically typed value which can be either - # null, a number, a string, a boolean, a recursive struct value, or a - # list of values. A producer of value is expected to set one of these - # variants. Absence of any variant indicates an error. - # - # The JSON representation for `Value` is JSON value. - # @!attribute [rw] null_value - # @return [::Google::Protobuf::NullValue] - # Represents a null value. - # - # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] number_value - # @return [::Float] - # Represents a double value. - # - # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] string_value - # @return [::String] - # Represents a string value. - # - # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bool_value - # @return [::Boolean] - # Represents a boolean value. - # - # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] struct_value - # @return [::Google::Protobuf::Struct] - # Represents a structured value. - # - # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] list_value - # @return [::Google::Protobuf::ListValue] - # Represents a repeated `Value`. - # - # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `ListValue` is a wrapper around a repeated field of values. - # - # The JSON representation for `ListValue` is JSON array. - # @!attribute [rw] values - # @return [::Array<::Google::Protobuf::Value>] - # Repeated field of dynamically typed values. - class ListValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `NullValue` is a singleton enumeration to represent the null value for the - # `Value` type union. - # - # The JSON representation for `NullValue` is JSON `null`. - module NullValue - # Null value. - NULL_VALUE = 0 - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 1b485b0c3456..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # Wrapper message for `double`. - # - # The JSON representation for `DoubleValue` is JSON number. - # @!attribute [rw] value - # @return [::Float] - # The double value. - class DoubleValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `float`. - # - # The JSON representation for `FloatValue` is JSON number. - # @!attribute [rw] value - # @return [::Float] - # The float value. - class FloatValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int64`. - # - # The JSON representation for `Int64Value` is JSON string. - # @!attribute [rw] value - # @return [::Integer] - # The int64 value. - class Int64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint64`. - # - # The JSON representation for `UInt64Value` is JSON string. - # @!attribute [rw] value - # @return [::Integer] - # The uint64 value. - class UInt64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int32`. - # - # The JSON representation for `Int32Value` is JSON number. - # @!attribute [rw] value - # @return [::Integer] - # The int32 value. - class Int32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint32`. - # - # The JSON representation for `UInt32Value` is JSON number. - # @!attribute [rw] value - # @return [::Integer] - # The uint32 value. - class UInt32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bool`. - # - # The JSON representation for `BoolValue` is JSON `true` and `false`. - # @!attribute [rw] value - # @return [::Boolean] - # The bool value. - class BoolValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `string`. - # - # The JSON representation for `StringValue` is JSON string. - # @!attribute [rw] value - # @return [::String] - # The string value. - class StringValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bytes`. - # - # The JSON representation for `BytesValue` is JSON string. - # @!attribute [rw] value - # @return [::String] - # The bytes value. - class BytesValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/type/latlng.rb deleted file mode 100644 index c15e78a39a56..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/proto_docs/google/type/latlng.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # An object that represents a latitude/longitude pair. This is expressed as a - # pair of doubles to represent degrees latitude and degrees longitude. Unless - # specified otherwise, this must conform to the - # WGS84 - # standard. Values must be within normalized ranges. - # @!attribute [rw] latitude - # @return [::Float] - # The latitude in degrees. It must be in the range [-90.0, +90.0]. - # @!attribute [rw] longitude - # @return [::Float] - # The longitude in degrees. It must be in the range [-180.0, +180.0]. - class LatLng - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-firestore-v1/snippets/Gemfile deleted file mode 100644 index 6aafafebdfaa..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-firestore-v1", path: "../" -else - gem "google-cloud-firestore-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-v1/snippets/firestore/batch_get_documents.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/batch_get_documents.rb deleted file mode 100644 index f71efdc2f1b1..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/batch_get_documents.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_BatchGetDocuments_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the batch_get_documents call in the Firestore 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::V1::Firestore::Client#batch_get_documents. -# -def batch_get_documents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new - - # Call the batch_get_documents method to start streaming. - output = client.batch_get_documents request - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse - output.each do |current_response| - p current_response - end -end -# [END firestore_v1_generated_Firestore_BatchGetDocuments_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/batch_write.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/batch_write.rb deleted file mode 100644 index 93e3a3f3ac99..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/batch_write.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_BatchWrite_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the batch_write call in the Firestore 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::V1::Firestore::Client#batch_write. -# -def batch_write - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::V1::BatchWriteRequest.new - - # Call the batch_write method. - result = client.batch_write request - - # The returned object is of type Google::Cloud::Firestore::V1::BatchWriteResponse. - p result -end -# [END firestore_v1_generated_Firestore_BatchWrite_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/begin_transaction.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/begin_transaction.rb deleted file mode 100644 index 110bf9f094b8..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/begin_transaction.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_BeginTransaction_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the begin_transaction call in the Firestore 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::V1::Firestore::Client#begin_transaction. -# -def begin_transaction - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::V1::BeginTransactionRequest.new - - # Call the begin_transaction method. - result = client.begin_transaction request - - # The returned object is of type Google::Cloud::Firestore::V1::BeginTransactionResponse. - p result -end -# [END firestore_v1_generated_Firestore_BeginTransaction_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/commit.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/commit.rb deleted file mode 100644 index 728f621b5c42..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/commit.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_Commit_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the commit call in the Firestore 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::V1::Firestore::Client#commit. -# -def commit - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::V1::CommitRequest.new - - # Call the commit method. - result = client.commit request - - # The returned object is of type Google::Cloud::Firestore::V1::CommitResponse. - p result -end -# [END firestore_v1_generated_Firestore_Commit_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/create_document.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/create_document.rb deleted file mode 100644 index 91b0ca458e0b..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/create_document.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_CreateDocument_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the create_document call in the Firestore 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::V1::Firestore::Client#create_document. -# -def create_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::V1::CreateDocumentRequest.new - - # Call the create_document method. - result = client.create_document request - - # The returned object is of type Google::Cloud::Firestore::V1::Document. - p result -end -# [END firestore_v1_generated_Firestore_CreateDocument_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/delete_document.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/delete_document.rb deleted file mode 100644 index 58f88b2364df..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/delete_document.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_DeleteDocument_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the delete_document call in the Firestore 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::V1::Firestore::Client#delete_document. -# -def delete_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::V1::DeleteDocumentRequest.new - - # Call the delete_document method. - result = client.delete_document request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END firestore_v1_generated_Firestore_DeleteDocument_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/execute_pipeline.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/execute_pipeline.rb deleted file mode 100644 index 2113693e5c50..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/execute_pipeline.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_ExecutePipeline_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the execute_pipeline call in the Firestore 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::V1::Firestore::Client#execute_pipeline. -# -def execute_pipeline - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::V1::ExecutePipelineRequest.new - - # Call the execute_pipeline method to start streaming. - output = client.execute_pipeline request - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Firestore::V1::ExecutePipelineResponse - output.each do |current_response| - p current_response - end -end -# [END firestore_v1_generated_Firestore_ExecutePipeline_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/get_document.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/get_document.rb deleted file mode 100644 index 6b7bb9690798..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/get_document.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_GetDocument_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the get_document call in the Firestore 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::V1::Firestore::Client#get_document. -# -def get_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::V1::GetDocumentRequest.new - - # Call the get_document method. - result = client.get_document request - - # The returned object is of type Google::Cloud::Firestore::V1::Document. - p result -end -# [END firestore_v1_generated_Firestore_GetDocument_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_collection_ids.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_collection_ids.rb deleted file mode 100644 index 9fd9635f9731..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_collection_ids.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_ListCollectionIds_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the list_collection_ids call in the Firestore 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::V1::Firestore::Client#list_collection_ids. -# -def list_collection_ids - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new - - # Call the list_collection_ids method. - result = client.list_collection_ids request - - # The returned object is of type Google::Cloud::Firestore::V1::ListCollectionIdsResponse. - p result -end -# [END firestore_v1_generated_Firestore_ListCollectionIds_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_documents.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_documents.rb deleted file mode 100644 index 50b574e03e61..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/list_documents.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_ListDocuments_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the list_documents call in the Firestore 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::V1::Firestore::Client#list_documents. -# -def list_documents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::V1::ListDocumentsRequest.new - - # Call the list_documents method. - result = client.list_documents 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::V1::Document. - p item - end -end -# [END firestore_v1_generated_Firestore_ListDocuments_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/listen.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/listen.rb deleted file mode 100644 index d704f8f68040..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/listen.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_Listen_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the listen call in the Firestore 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::V1::Firestore::Client#listen. -# -def listen - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the listen method to start streaming. - output = client.listen input - - # Send requests on the stream. For each request object, set fields by - # passing keyword arguments. Be sure to close the stream when done. - input << Google::Cloud::Firestore::V1::ListenRequest.new - input << Google::Cloud::Firestore::V1::ListenRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Firestore::V1::ListenResponse - output.each do |current_response| - p current_response - end -end -# [END firestore_v1_generated_Firestore_Listen_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/partition_query.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/partition_query.rb deleted file mode 100644 index 3b642ca7464a..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/partition_query.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_PartitionQuery_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the partition_query call in the Firestore 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::V1::Firestore::Client#partition_query. -# -def partition_query - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::V1::PartitionQueryRequest.new - - # Call the partition_query method. - result = client.partition_query 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::V1::Cursor. - p item - end -end -# [END firestore_v1_generated_Firestore_PartitionQuery_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/rollback.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/rollback.rb deleted file mode 100644 index 5a48928fa963..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/rollback.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_Rollback_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the rollback call in the Firestore 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::V1::Firestore::Client#rollback. -# -def rollback - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::V1::RollbackRequest.new - - # Call the rollback method. - result = client.rollback request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END firestore_v1_generated_Firestore_Rollback_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_aggregation_query.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_aggregation_query.rb deleted file mode 100644 index feb15a4d908f..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_aggregation_query.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_RunAggregationQuery_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the run_aggregation_query call in the Firestore 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::V1::Firestore::Client#run_aggregation_query. -# -def run_aggregation_query - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new - - # Call the run_aggregation_query method to start streaming. - output = client.run_aggregation_query request - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse - output.each do |current_response| - p current_response - end -end -# [END firestore_v1_generated_Firestore_RunAggregationQuery_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_query.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_query.rb deleted file mode 100644 index 741c1e754894..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/run_query.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_RunQuery_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the run_query call in the Firestore 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::V1::Firestore::Client#run_query. -# -def run_query - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::V1::RunQueryRequest.new - - # Call the run_query method to start streaming. - output = client.run_query request - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Firestore::V1::RunQueryResponse - output.each do |current_response| - p current_response - end -end -# [END firestore_v1_generated_Firestore_RunQuery_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/update_document.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/update_document.rb deleted file mode 100644 index c1c4d96bad4b..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/update_document.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_UpdateDocument_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the update_document call in the Firestore 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::V1::Firestore::Client#update_document. -# -def update_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Firestore::V1::UpdateDocumentRequest.new - - # Call the update_document method. - result = client.update_document request - - # The returned object is of type Google::Cloud::Firestore::V1::Document. - p result -end -# [END firestore_v1_generated_Firestore_UpdateDocument_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/write.rb b/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/write.rb deleted file mode 100644 index 55103736dd0e..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/firestore/write.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START firestore_v1_generated_Firestore_Write_sync] -require "google/cloud/firestore/v1" - -## -# Snippet for the write call in the Firestore 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::V1::Firestore::Client#write. -# -def write - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Firestore::V1::Firestore::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the write method to start streaming. - output = client.write input - - # Send requests on the stream. For each request object, set fields by - # passing keyword arguments. Be sure to close the stream when done. - input << Google::Cloud::Firestore::V1::WriteRequest.new - input << Google::Cloud::Firestore::V1::WriteRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Firestore::V1::WriteResponse - output.each do |current_response| - p current_response - end -end -# [END firestore_v1_generated_Firestore_Write_sync] diff --git a/owl-bot-staging/google-cloud-firestore-v1/snippets/snippet_metadata_google.firestore.v1.json b/owl-bot-staging/google-cloud-firestore-v1/snippets/snippet_metadata_google.firestore.v1.json deleted file mode 100644 index 87be441de1ce..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/snippets/snippet_metadata_google.firestore.v1.json +++ /dev/null @@ -1,695 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-firestore-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.firestore.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "firestore_v1_generated_Firestore_GetDocument_sync", - "title": "Snippet for the get_document call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#get_document.", - "file": "firestore/get_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_document", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#get_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::GetDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::V1::Document", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "GetDocument", - "full_name": "google.firestore.v1.Firestore.GetDocument", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_ListDocuments_sync", - "title": "Snippet for the list_documents call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#list_documents.", - "file": "firestore/list_documents.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_documents", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#list_documents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::ListDocumentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::V1::ListDocumentsResponse", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "ListDocuments", - "full_name": "google.firestore.v1.Firestore.ListDocuments", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_UpdateDocument_sync", - "title": "Snippet for the update_document call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#update_document.", - "file": "firestore/update_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_document", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#update_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::UpdateDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::V1::Document", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "UpdateDocument", - "full_name": "google.firestore.v1.Firestore.UpdateDocument", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_DeleteDocument_sync", - "title": "Snippet for the delete_document call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#delete_document.", - "file": "firestore/delete_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_document", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#delete_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::DeleteDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "DeleteDocument", - "full_name": "google.firestore.v1.Firestore.DeleteDocument", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_BatchGetDocuments_sync", - "title": "Snippet for the batch_get_documents call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#batch_get_documents.", - "file": "firestore/batch_get_documents.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_get_documents", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#batch_get_documents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "BatchGetDocuments", - "full_name": "google.firestore.v1.Firestore.BatchGetDocuments", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 49, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_BeginTransaction_sync", - "title": "Snippet for the begin_transaction call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#begin_transaction.", - "file": "firestore/begin_transaction.rb", - "language": "RUBY", - "client_method": { - "short_name": "begin_transaction", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#begin_transaction", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::BeginTransactionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::V1::BeginTransactionResponse", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "BeginTransaction", - "full_name": "google.firestore.v1.Firestore.BeginTransaction", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_Commit_sync", - "title": "Snippet for the commit call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#commit.", - "file": "firestore/commit.rb", - "language": "RUBY", - "client_method": { - "short_name": "commit", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#commit", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::CommitRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::V1::CommitResponse", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "Commit", - "full_name": "google.firestore.v1.Firestore.Commit", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_Rollback_sync", - "title": "Snippet for the rollback call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#rollback.", - "file": "firestore/rollback.rb", - "language": "RUBY", - "client_method": { - "short_name": "rollback", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#rollback", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::RollbackRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "Rollback", - "full_name": "google.firestore.v1.Firestore.Rollback", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_RunQuery_sync", - "title": "Snippet for the run_query call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#run_query.", - "file": "firestore/run_query.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_query", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#run_query", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::RunQueryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::V1::RunQueryResponse", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "RunQuery", - "full_name": "google.firestore.v1.Firestore.RunQuery", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 49, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_ExecutePipeline_sync", - "title": "Snippet for the execute_pipeline call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#execute_pipeline.", - "file": "firestore/execute_pipeline.rb", - "language": "RUBY", - "client_method": { - "short_name": "execute_pipeline", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#execute_pipeline", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::ExecutePipelineRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::V1::ExecutePipelineResponse", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "ExecutePipeline", - "full_name": "google.firestore.v1.Firestore.ExecutePipeline", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 49, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_RunAggregationQuery_sync", - "title": "Snippet for the run_aggregation_query call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#run_aggregation_query.", - "file": "firestore/run_aggregation_query.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_aggregation_query", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#run_aggregation_query", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::RunAggregationQueryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::V1::RunAggregationQueryResponse", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "RunAggregationQuery", - "full_name": "google.firestore.v1.Firestore.RunAggregationQuery", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 49, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_PartitionQuery_sync", - "title": "Snippet for the partition_query call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#partition_query.", - "file": "firestore/partition_query.rb", - "language": "RUBY", - "client_method": { - "short_name": "partition_query", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#partition_query", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::PartitionQueryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::V1::PartitionQueryResponse", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "PartitionQuery", - "full_name": "google.firestore.v1.Firestore.PartitionQuery", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_Write_sync", - "title": "Snippet for the write call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#write.", - "file": "firestore/write.rb", - "language": "RUBY", - "client_method": { - "short_name": "write", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#write", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::WriteRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::V1::WriteResponse", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "Write", - "full_name": "google.firestore.v1.Firestore.Write", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_Listen_sync", - "title": "Snippet for the listen call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#listen.", - "file": "firestore/listen.rb", - "language": "RUBY", - "client_method": { - "short_name": "listen", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#listen", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::ListenRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::V1::ListenResponse", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "Listen", - "full_name": "google.firestore.v1.Firestore.Listen", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_ListCollectionIds_sync", - "title": "Snippet for the list_collection_ids call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#list_collection_ids.", - "file": "firestore/list_collection_ids.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_collection_ids", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#list_collection_ids", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::ListCollectionIdsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::V1::ListCollectionIdsResponse", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "ListCollectionIds", - "full_name": "google.firestore.v1.Firestore.ListCollectionIds", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_BatchWrite_sync", - "title": "Snippet for the batch_write call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#batch_write.", - "file": "firestore/batch_write.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_write", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#batch_write", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::BatchWriteRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::V1::BatchWriteResponse", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "BatchWrite", - "full_name": "google.firestore.v1.Firestore.BatchWrite", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "firestore_v1_generated_Firestore_CreateDocument_sync", - "title": "Snippet for the create_document call in the Firestore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Firestore::V1::Firestore::Client#create_document.", - "file": "firestore/create_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_document", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client#create_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Firestore::V1::CreateDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Firestore::V1::Document", - "client": { - "short_name": "Firestore::Client", - "full_name": "::Google::Cloud::Firestore::V1::Firestore::Client" - }, - "method": { - "short_name": "CreateDocument", - "full_name": "google.firestore.v1.Firestore.CreateDocument", - "service": { - "short_name": "Firestore", - "full_name": "google.firestore.v1.Firestore" - } - } - }, - "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-v1/test/google/cloud/firestore/v1/firestore_rest_test.rb b/owl-bot-staging/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_rest_test.rb deleted file mode 100644 index f743e99d9d50..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_rest_test.rb +++ /dev/null @@ -1,951 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/firestore/v1/firestore_pb" -require "google/cloud/firestore/v1/firestore/rest" - - -class ::Google::Cloud::Firestore::V1::Firestore::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_document - # Create test objects. - client_result = ::Google::Cloud::Firestore::V1::Document.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - mask = {} - transaction = "hello world" - - get_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_get_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_document_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_document({ name: name, mask: mask, transaction: transaction }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_document name: name, mask: mask, transaction: transaction do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_document ::Google::Cloud::Firestore::V1::GetDocumentRequest.new(name: name, mask: mask, transaction: transaction) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_document({ name: name, mask: mask, transaction: transaction }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_document(::Google::Cloud::Firestore::V1::GetDocumentRequest.new(name: name, mask: mask, transaction: transaction), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_document_client_stub.call_count - end - end - end - - def test_list_documents - # Create test objects. - client_result = ::Google::Cloud::Firestore::V1::ListDocumentsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - collection_id = "hello world" - page_size = 42 - page_token = "hello world" - order_by = "hello world" - mask = {} - transaction = "hello world" - show_missing = true - - list_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_list_documents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_documents_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_documents({ parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_documents parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_documents ::Google::Cloud::Firestore::V1::ListDocumentsRequest.new(parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_documents({ parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_documents(::Google::Cloud::Firestore::V1::ListDocumentsRequest.new(parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_documents_client_stub.call_count - end - end - end - - def test_update_document - # Create test objects. - client_result = ::Google::Cloud::Firestore::V1::Document.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - document = {} - update_mask = {} - mask = {} - current_document = {} - - update_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_update_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_document_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_document({ document: document, update_mask: update_mask, mask: mask, current_document: current_document }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_document document: document, update_mask: update_mask, mask: mask, current_document: current_document do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_document ::Google::Cloud::Firestore::V1::UpdateDocumentRequest.new(document: document, update_mask: update_mask, mask: mask, current_document: current_document) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_document({ document: document, update_mask: update_mask, mask: mask, current_document: current_document }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_document(::Google::Cloud::Firestore::V1::UpdateDocumentRequest.new(document: document, update_mask: update_mask, mask: mask, current_document: current_document), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_document_client_stub.call_count - end - end - end - - def test_delete_document - # 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" - current_document = {} - - delete_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_delete_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_document_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_document({ name: name, current_document: current_document }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_document name: name, current_document: current_document do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_document ::Google::Cloud::Firestore::V1::DeleteDocumentRequest.new(name: name, current_document: current_document) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_document({ name: name, current_document: current_document }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_document(::Google::Cloud::Firestore::V1::DeleteDocumentRequest.new(name: name, current_document: current_document), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_document_client_stub.call_count - end - end - end - - def test_batch_get_documents - # Create test objects. - client_result = ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - database = "hello world" - documents = ["hello world"] - mask = {} - transaction = "hello world" - - batch_get_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_batch_get_documents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_get_documents_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_get_documents({ database: database, documents: documents, mask: mask, transaction: transaction }) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use named arguments - client.batch_get_documents database: database, documents: documents, mask: mask, transaction: transaction do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object - client.batch_get_documents ::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new(database: database, documents: documents, mask: mask, transaction: transaction) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use hash object with options - client.batch_get_documents({ database: database, documents: documents, mask: mask, transaction: transaction }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object with options - client.batch_get_documents(::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new(database: database, documents: documents, mask: mask, transaction: transaction), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Verify method calls - assert_equal 5, batch_get_documents_client_stub.call_count - end - end - end - - def test_begin_transaction - # Create test objects. - client_result = ::Google::Cloud::Firestore::V1::BeginTransactionResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - database = "hello world" - options = {} - - begin_transaction_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_begin_transaction_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, begin_transaction_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.begin_transaction({ database: database, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.begin_transaction database: database, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.begin_transaction ::Google::Cloud::Firestore::V1::BeginTransactionRequest.new(database: database, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.begin_transaction({ database: database, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.begin_transaction(::Google::Cloud::Firestore::V1::BeginTransactionRequest.new(database: database, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, begin_transaction_client_stub.call_count - end - end - end - - def test_commit - # Create test objects. - client_result = ::Google::Cloud::Firestore::V1::CommitResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - database = "hello world" - writes = [{}] - transaction = "hello world" - - commit_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_commit_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, commit_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.commit({ database: database, writes: writes, transaction: transaction }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.commit database: database, writes: writes, transaction: transaction do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.commit ::Google::Cloud::Firestore::V1::CommitRequest.new(database: database, writes: writes, transaction: transaction) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.commit({ database: database, writes: writes, transaction: transaction }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.commit(::Google::Cloud::Firestore::V1::CommitRequest.new(database: database, writes: writes, transaction: transaction), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, commit_client_stub.call_count - end - end - end - - def test_rollback - # 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. - database = "hello world" - transaction = "hello world" - - rollback_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_rollback_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, rollback_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.rollback({ database: database, transaction: transaction }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.rollback database: database, transaction: transaction do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.rollback ::Google::Cloud::Firestore::V1::RollbackRequest.new(database: database, transaction: transaction) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.rollback({ database: database, transaction: transaction }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.rollback(::Google::Cloud::Firestore::V1::RollbackRequest.new(database: database, transaction: transaction), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, rollback_client_stub.call_count - end - end - end - - def test_run_query - # Create test objects. - client_result = ::Google::Cloud::Firestore::V1::RunQueryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - structured_query = {} - transaction = "hello world" - explain_options = {} - - run_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_run_query_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, run_query_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_query({ parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options }) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use named arguments - client.run_query parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object - client.run_query ::Google::Cloud::Firestore::V1::RunQueryRequest.new(parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use hash object with options - client.run_query({ parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object with options - client.run_query(::Google::Cloud::Firestore::V1::RunQueryRequest.new(parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Verify method calls - assert_equal 5, run_query_client_stub.call_count - end - end - end - - def test_execute_pipeline - # Create test objects. - client_result = ::Google::Cloud::Firestore::V1::ExecutePipelineResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - database = "hello world" - structured_pipeline = {} - transaction = "hello world" - - execute_pipeline_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_execute_pipeline_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, execute_pipeline_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.execute_pipeline({ database: database, structured_pipeline: structured_pipeline, transaction: transaction }) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use named arguments - client.execute_pipeline database: database, structured_pipeline: structured_pipeline, transaction: transaction do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object - client.execute_pipeline ::Google::Cloud::Firestore::V1::ExecutePipelineRequest.new(database: database, structured_pipeline: structured_pipeline, transaction: transaction) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use hash object with options - client.execute_pipeline({ database: database, structured_pipeline: structured_pipeline, transaction: transaction }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object with options - client.execute_pipeline(::Google::Cloud::Firestore::V1::ExecutePipelineRequest.new(database: database, structured_pipeline: structured_pipeline, transaction: transaction), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Verify method calls - assert_equal 5, execute_pipeline_client_stub.call_count - end - end - end - - def test_run_aggregation_query - # Create test objects. - client_result = ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - structured_aggregation_query = {} - transaction = "hello world" - explain_options = {} - - run_aggregation_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_run_aggregation_query_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, run_aggregation_query_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_aggregation_query({ parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options }) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use named arguments - client.run_aggregation_query parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object - client.run_aggregation_query ::Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new(parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use hash object with options - client.run_aggregation_query({ parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object with options - client.run_aggregation_query(::Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new(parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Verify method calls - assert_equal 5, run_aggregation_query_client_stub.call_count - end - end - end - - def test_partition_query - # Create test objects. - client_result = ::Google::Cloud::Firestore::V1::PartitionQueryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - structured_query = {} - partition_count = 42 - page_token = "hello world" - page_size = 42 - read_time = {} - - partition_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_partition_query_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, partition_query_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.partition_query({ parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.partition_query parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.partition_query ::Google::Cloud::Firestore::V1::PartitionQueryRequest.new(parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.partition_query({ parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.partition_query(::Google::Cloud::Firestore::V1::PartitionQueryRequest.new(parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, partition_query_client_stub.call_count - end - end - end - - def test_list_collection_ids - # Create test objects. - client_result = ::Google::Cloud::Firestore::V1::ListCollectionIdsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - read_time = {} - - list_collection_ids_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_list_collection_ids_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_collection_ids_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_collection_ids({ parent: parent, page_size: page_size, page_token: page_token, read_time: read_time }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_collection_ids parent: parent, page_size: page_size, page_token: page_token, read_time: read_time do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_collection_ids ::Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new(parent: parent, page_size: page_size, page_token: page_token, read_time: read_time) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_collection_ids({ parent: parent, page_size: page_size, page_token: page_token, read_time: read_time }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_collection_ids(::Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new(parent: parent, page_size: page_size, page_token: page_token, read_time: read_time), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_collection_ids_client_stub.call_count - end - end - end - - def test_batch_write - # Create test objects. - client_result = ::Google::Cloud::Firestore::V1::BatchWriteResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - database = "hello world" - writes = [{}] - labels = {} - - batch_write_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_batch_write_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_write_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_write({ database: database, writes: writes, labels: labels }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_write database: database, writes: writes, labels: labels do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_write ::Google::Cloud::Firestore::V1::BatchWriteRequest.new(database: database, writes: writes, labels: labels) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_write({ database: database, writes: writes, labels: labels }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_write(::Google::Cloud::Firestore::V1::BatchWriteRequest.new(database: database, writes: writes, labels: labels), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_write_client_stub.call_count - end - end - end - - def test_create_document - # Create test objects. - client_result = ::Google::Cloud::Firestore::V1::Document.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - collection_id = "hello world" - document_id = "hello world" - document = {} - mask = {} - - create_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.stub :transcode_create_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_document_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_document({ parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_document parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_document ::Google::Cloud::Firestore::V1::CreateDocumentRequest.new(parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_document({ parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_document(::Google::Cloud::Firestore::V1::CreateDocumentRequest.new(parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_document_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::V1::Firestore::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::V1::Firestore::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_test.rb b/owl-bot-staging/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_test.rb deleted file mode 100644 index 2c489e91476d..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_test.rb +++ /dev/null @@ -1,1329 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/firestore/v1/firestore_pb" -require "google/cloud/firestore/v1/firestore" - -class ::Google::Cloud::Firestore::V1::Firestore::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_document - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::V1::Document.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" - mask = {} - transaction = "hello world" - - get_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_document, name - assert_kind_of ::Google::Cloud::Firestore::V1::GetDocumentRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::DocumentMask), request["mask"] - assert_equal "hello world", request["transaction"] - assert_equal :transaction, request.consistency_selector - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_document_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_document({ name: name, mask: mask, transaction: transaction }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_document name: name, mask: mask, transaction: transaction do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_document ::Google::Cloud::Firestore::V1::GetDocumentRequest.new(name: name, mask: mask, transaction: transaction) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_document({ name: name, mask: mask, transaction: transaction }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_document(::Google::Cloud::Firestore::V1::GetDocumentRequest.new(name: name, mask: mask, transaction: transaction), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_document_client_stub.call_rpc_count - end - end - - def test_list_documents - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::V1::ListDocumentsResponse.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" - collection_id = "hello world" - page_size = 42 - page_token = "hello world" - order_by = "hello world" - mask = {} - transaction = "hello world" - show_missing = true - - list_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_documents, name - assert_kind_of ::Google::Cloud::Firestore::V1::ListDocumentsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["collection_id"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["order_by"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::DocumentMask), request["mask"] - assert_equal "hello world", request["transaction"] - assert_equal :transaction, request.consistency_selector - assert_equal true, request["show_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_documents_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_documents({ parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing }) 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_documents parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing 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_documents ::Google::Cloud::Firestore::V1::ListDocumentsRequest.new(parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing) 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_documents({ parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing }, 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_documents(::Google::Cloud::Firestore::V1::ListDocumentsRequest.new(parent: parent, collection_id: collection_id, page_size: page_size, page_token: page_token, order_by: order_by, mask: mask, transaction: transaction, show_missing: show_missing), 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_documents_client_stub.call_rpc_count - end - end - - def test_update_document - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::V1::Document.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. - document = {} - update_mask = {} - mask = {} - current_document = {} - - update_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_document, name - assert_kind_of ::Google::Cloud::Firestore::V1::UpdateDocumentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::Document), request["document"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::DocumentMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::DocumentMask), request["mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::Precondition), request["current_document"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_document_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_document({ document: document, update_mask: update_mask, mask: mask, current_document: current_document }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_document document: document, update_mask: update_mask, mask: mask, current_document: current_document do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_document ::Google::Cloud::Firestore::V1::UpdateDocumentRequest.new(document: document, update_mask: update_mask, mask: mask, current_document: current_document) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_document({ document: document, update_mask: update_mask, mask: mask, current_document: current_document }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_document(::Google::Cloud::Firestore::V1::UpdateDocumentRequest.new(document: document, update_mask: update_mask, mask: mask, current_document: current_document), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_document_client_stub.call_rpc_count - end - end - - def test_delete_document - # 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" - current_document = {} - - delete_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_document, name - assert_kind_of ::Google::Cloud::Firestore::V1::DeleteDocumentRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::Precondition), request["current_document"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_document_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_document({ name: name, current_document: current_document }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_document name: name, current_document: current_document do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_document ::Google::Cloud::Firestore::V1::DeleteDocumentRequest.new(name: name, current_document: current_document) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_document({ name: name, current_document: current_document }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_document(::Google::Cloud::Firestore::V1::DeleteDocumentRequest.new(name: name, current_document: current_document), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_document_client_stub.call_rpc_count - end - end - - def test_batch_get_documents - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a server streaming method. - database = "hello world" - documents = ["hello world"] - mask = {} - transaction = "hello world" - - batch_get_documents_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :batch_get_documents, name - assert_kind_of ::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest, request - assert_equal "hello world", request["database"] - assert_equal ["hello world"], request["documents"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::DocumentMask), request["mask"] - assert_equal "hello world", request["transaction"] - assert_equal :transaction, request.consistency_selector - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_get_documents_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_get_documents({ database: database, documents: documents, mask: mask, transaction: transaction }) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse, r - end - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_get_documents database: database, documents: documents, mask: mask, transaction: transaction do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_get_documents ::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new(database: database, documents: documents, mask: mask, transaction: transaction) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse, r - end - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_get_documents({ database: database, documents: documents, mask: mask, transaction: transaction }, grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_get_documents(::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new(database: database, documents: documents, mask: mask, transaction: transaction), grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse, r - end - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_get_documents_client_stub.call_rpc_count - end - end - - def test_begin_transaction - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::V1::BeginTransactionResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = "hello world" - options = {} - - begin_transaction_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :begin_transaction, name - assert_kind_of ::Google::Cloud::Firestore::V1::BeginTransactionRequest, request - assert_equal "hello world", request["database"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::TransactionOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, begin_transaction_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.begin_transaction({ database: database, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.begin_transaction database: database, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.begin_transaction ::Google::Cloud::Firestore::V1::BeginTransactionRequest.new(database: database, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.begin_transaction({ database: database, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.begin_transaction(::Google::Cloud::Firestore::V1::BeginTransactionRequest.new(database: database, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, begin_transaction_client_stub.call_rpc_count - end - end - - def test_commit - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::V1::CommitResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = "hello world" - writes = [{}] - transaction = "hello world" - - commit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :commit, name - assert_kind_of ::Google::Cloud::Firestore::V1::CommitRequest, request - assert_equal "hello world", request["database"] - assert_kind_of ::Google::Cloud::Firestore::V1::Write, request["writes"].first - assert_equal "hello world", request["transaction"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, commit_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.commit({ database: database, writes: writes, transaction: transaction }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.commit database: database, writes: writes, transaction: transaction do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.commit ::Google::Cloud::Firestore::V1::CommitRequest.new(database: database, writes: writes, transaction: transaction) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.commit({ database: database, writes: writes, transaction: transaction }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.commit(::Google::Cloud::Firestore::V1::CommitRequest.new(database: database, writes: writes, transaction: transaction), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, commit_client_stub.call_rpc_count - end - end - - def test_rollback - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = "hello world" - transaction = "hello world" - - rollback_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :rollback, name - assert_kind_of ::Google::Cloud::Firestore::V1::RollbackRequest, request - assert_equal "hello world", request["database"] - assert_equal "hello world", request["transaction"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, rollback_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.rollback({ database: database, transaction: transaction }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.rollback database: database, transaction: transaction do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.rollback ::Google::Cloud::Firestore::V1::RollbackRequest.new(database: database, transaction: transaction) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.rollback({ database: database, transaction: transaction }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.rollback(::Google::Cloud::Firestore::V1::RollbackRequest.new(database: database, transaction: transaction), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, rollback_client_stub.call_rpc_count - end - end - - def test_run_query - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::V1::RunQueryResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a server streaming method. - parent = "hello world" - structured_query = {} - transaction = "hello world" - explain_options = {} - - run_query_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :run_query, name - assert_kind_of ::Google::Cloud::Firestore::V1::RunQueryRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::StructuredQuery), request["structured_query"] - assert_equal :structured_query, request.query_type - assert_equal "hello world", request["transaction"] - assert_equal :transaction, request.consistency_selector - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::ExplainOptions), request["explain_options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_query_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_query({ parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options }) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::RunQueryResponse, r - end - assert_equal grpc_operation, operation - end - - # Use named arguments - client.run_query parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::RunQueryResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.run_query ::Google::Cloud::Firestore::V1::RunQueryRequest.new(parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::RunQueryResponse, r - end - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.run_query({ parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options }, grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::RunQueryResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.run_query(::Google::Cloud::Firestore::V1::RunQueryRequest.new(parent: parent, structured_query: structured_query, transaction: transaction, explain_options: explain_options), grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::RunQueryResponse, r - end - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, run_query_client_stub.call_rpc_count - end - end - - def test_execute_pipeline - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::V1::ExecutePipelineResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a server streaming method. - database = "hello world" - structured_pipeline = {} - transaction = "hello world" - - execute_pipeline_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :execute_pipeline, name - assert_kind_of ::Google::Cloud::Firestore::V1::ExecutePipelineRequest, request - assert_equal "hello world", request["database"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::StructuredPipeline), request["structured_pipeline"] - assert_equal :structured_pipeline, request.pipeline_type - assert_equal "hello world", request["transaction"] - assert_equal :transaction, request.consistency_selector - refute_nil options - end - - Gapic::ServiceStub.stub :new, execute_pipeline_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.execute_pipeline({ database: database, structured_pipeline: structured_pipeline, transaction: transaction }) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::ExecutePipelineResponse, r - end - assert_equal grpc_operation, operation - end - - # Use named arguments - client.execute_pipeline database: database, structured_pipeline: structured_pipeline, transaction: transaction do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::ExecutePipelineResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.execute_pipeline ::Google::Cloud::Firestore::V1::ExecutePipelineRequest.new(database: database, structured_pipeline: structured_pipeline, transaction: transaction) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::ExecutePipelineResponse, r - end - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.execute_pipeline({ database: database, structured_pipeline: structured_pipeline, transaction: transaction }, grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::ExecutePipelineResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.execute_pipeline(::Google::Cloud::Firestore::V1::ExecutePipelineRequest.new(database: database, structured_pipeline: structured_pipeline, transaction: transaction), grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::ExecutePipelineResponse, r - end - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, execute_pipeline_client_stub.call_rpc_count - end - end - - def test_run_aggregation_query - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a server streaming method. - parent = "hello world" - structured_aggregation_query = {} - transaction = "hello world" - explain_options = {} - - run_aggregation_query_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :run_aggregation_query, name - assert_kind_of ::Google::Cloud::Firestore::V1::RunAggregationQueryRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::StructuredAggregationQuery), request["structured_aggregation_query"] - assert_equal :structured_aggregation_query, request.query_type - assert_equal "hello world", request["transaction"] - assert_equal :transaction, request.consistency_selector - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::ExplainOptions), request["explain_options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_aggregation_query_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_aggregation_query({ parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options }) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse, r - end - assert_equal grpc_operation, operation - end - - # Use named arguments - client.run_aggregation_query parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.run_aggregation_query ::Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new(parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse, r - end - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.run_aggregation_query({ parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options }, grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.run_aggregation_query(::Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new(parent: parent, structured_aggregation_query: structured_aggregation_query, transaction: transaction, explain_options: explain_options), grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse, r - end - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, run_aggregation_query_client_stub.call_rpc_count - end - end - - def test_partition_query - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::V1::PartitionQueryResponse.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" - structured_query = {} - partition_count = 42 - page_token = "hello world" - page_size = 42 - read_time = {} - - partition_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :partition_query, name - assert_kind_of ::Google::Cloud::Firestore::V1::PartitionQueryRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::StructuredQuery), request["structured_query"] - assert_equal :structured_query, request.query_type - assert_equal 42, request["partition_count"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] - assert_equal :read_time, request.consistency_selector - refute_nil options - end - - Gapic::ServiceStub.stub :new, partition_query_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.partition_query({ parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time }) 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.partition_query parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time 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.partition_query ::Google::Cloud::Firestore::V1::PartitionQueryRequest.new(parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time) 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.partition_query({ parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time }, 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.partition_query(::Google::Cloud::Firestore::V1::PartitionQueryRequest.new(parent: parent, structured_query: structured_query, partition_count: partition_count, page_token: page_token, page_size: page_size, read_time: read_time), 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, partition_query_client_stub.call_rpc_count - end - end - - def test_write - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::V1::WriteResponse.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 bidi streaming method. - database = "hello world" - stream_id = "hello world" - writes = [{}] - stream_token = "hello world" - labels = {} - - write_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :write, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, write_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels } - request_proto = ::Google::Cloud::Firestore::V1::WriteRequest.new database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels - enum_input = [request_hash, request_proto].to_enum - client.write enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::WriteResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels } - request_proto = ::Google::Cloud::Firestore::V1::WriteRequest.new database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels - stream_input = Gapic::StreamInput.new - client.write stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::WriteResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Use enumerable object with hash and protobuf object with options. - request_hash = { database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels } - request_proto = ::Google::Cloud::Firestore::V1::WriteRequest.new database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels - enum_input = [request_hash, request_proto].to_enum - client.write enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::WriteResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels } - request_proto = ::Google::Cloud::Firestore::V1::WriteRequest.new database: database, stream_id: stream_id, writes: writes, stream_token: stream_token, labels: labels - stream_input = Gapic::StreamInput.new - client.write stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::WriteResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Verify method calls - assert_equal 4, write_client_stub.call_rpc_count - write_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::WriteRequest, r - assert_equal "hello world", r["database"] - assert_equal "hello world", r["stream_id"] - assert_kind_of ::Google::Cloud::Firestore::V1::Write, r["writes"].first - assert_equal "hello world", r["stream_token"] - assert_equal({}, r["labels"].to_h) - end - end - end - end - - def test_listen - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::V1::ListenResponse.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 bidi streaming method. - database = "hello world" - add_target = {} - labels = {} - - listen_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :listen, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, listen_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { database: database, add_target: add_target, labels: labels } - request_proto = ::Google::Cloud::Firestore::V1::ListenRequest.new database: database, add_target: add_target, labels: labels - enum_input = [request_hash, request_proto].to_enum - client.listen enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::ListenResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { database: database, add_target: add_target, labels: labels } - request_proto = ::Google::Cloud::Firestore::V1::ListenRequest.new database: database, add_target: add_target, labels: labels - stream_input = Gapic::StreamInput.new - client.listen stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::ListenResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Use enumerable object with hash and protobuf object with options. - request_hash = { database: database, add_target: add_target, labels: labels } - request_proto = ::Google::Cloud::Firestore::V1::ListenRequest.new database: database, add_target: add_target, labels: labels - enum_input = [request_hash, request_proto].to_enum - client.listen enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::ListenResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { database: database, add_target: add_target, labels: labels } - request_proto = ::Google::Cloud::Firestore::V1::ListenRequest.new database: database, add_target: add_target, labels: labels - stream_input = Gapic::StreamInput.new - client.listen stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::ListenResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Verify method calls - assert_equal 4, listen_client_stub.call_rpc_count - listen_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::Firestore::V1::ListenRequest, r - assert_equal "hello world", r["database"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::Target), r["add_target"] - assert_equal :add_target, r.target_change - assert_equal({}, r["labels"].to_h) - end - end - end - end - - def test_list_collection_ids - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::V1::ListCollectionIdsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - read_time = {} - - list_collection_ids_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_collection_ids, name - assert_kind_of ::Google::Cloud::Firestore::V1::ListCollectionIdsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["read_time"] - assert_equal :read_time, request.consistency_selector - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_collection_ids_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_collection_ids({ parent: parent, page_size: page_size, page_token: page_token, read_time: read_time }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_collection_ids parent: parent, page_size: page_size, page_token: page_token, read_time: read_time do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_collection_ids ::Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new(parent: parent, page_size: page_size, page_token: page_token, read_time: read_time) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_collection_ids({ parent: parent, page_size: page_size, page_token: page_token, read_time: read_time }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_collection_ids(::Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new(parent: parent, page_size: page_size, page_token: page_token, read_time: read_time), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_collection_ids_client_stub.call_rpc_count - end - end - - def test_batch_write - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::V1::BatchWriteResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - database = "hello world" - writes = [{}] - labels = {} - - batch_write_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_write, name - assert_kind_of ::Google::Cloud::Firestore::V1::BatchWriteRequest, request - assert_equal "hello world", request["database"] - assert_kind_of ::Google::Cloud::Firestore::V1::Write, request["writes"].first - assert_equal({}, request["labels"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_write_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_write({ database: database, writes: writes, labels: labels }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_write database: database, writes: writes, labels: labels do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_write ::Google::Cloud::Firestore::V1::BatchWriteRequest.new(database: database, writes: writes, labels: labels) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_write({ database: database, writes: writes, labels: labels }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_write(::Google::Cloud::Firestore::V1::BatchWriteRequest.new(database: database, writes: writes, labels: labels), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_write_client_stub.call_rpc_count - end - end - - def test_create_document - # Create GRPC objects. - grpc_response = ::Google::Cloud::Firestore::V1::Document.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" - collection_id = "hello world" - document_id = "hello world" - document = {} - mask = {} - - create_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_document, name - assert_kind_of ::Google::Cloud::Firestore::V1::CreateDocumentRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["collection_id"] - assert_equal "hello world", request["document_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::Document), request["document"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Firestore::V1::DocumentMask), request["mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_document_client_stub do - # Create client - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_document({ parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_document parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_document ::Google::Cloud::Firestore::V1::CreateDocumentRequest.new(parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_document({ parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_document(::Google::Cloud::Firestore::V1::CreateDocumentRequest.new(parent: parent, collection_id: collection_id, document_id: document_id, document: document, mask: mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_document_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::V1::Firestore::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::V1::Firestore::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Firestore::V1::Firestore::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-firestore-v1/test/helper.rb b/owl-bot-staging/google-cloud-firestore-v1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-firestore-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"