From 6e6d476ddb90af3f9effbe9107248cccb4b0b865 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 7 Oct 2024 21:55:47 +0000 Subject: [PATCH 1/2] feat: Support for field update operators in the Datastore API and resolution strategies when there is a conflict at write time PiperOrigin-RevId: 683253625 Source-Link: https://github.com/googleapis/googleapis/commit/3effbf23b1a1d1fe1306356e94397e20d01d31a0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5dd983c76417f2ad88f9d47438c48c27d5ac0e27 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWRhdGFzdG9yZS12MS8uT3dsQm90LnlhbWwiLCJoIjoiNWRkOTgzYzc2NDE3ZjJhZDg4ZjlkNDc0MzhjNDhjMjdkNWFjMGUyNyJ9 --- .../google-cloud-datastore-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-datastore-v1/.rubocop.yml | 33 + .../google-cloud-datastore-v1/.toys.rb | 28 + .../google-cloud-datastore-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 ++ .../google-cloud-datastore-v1/CHANGELOG.md | 2 + .../google-cloud-datastore-v1/Gemfile | 11 + .../google-cloud-datastore-v1/LICENSE.md | 201 +++ .../google-cloud-datastore-v1/README.md | 144 ++ .../google-cloud-datastore-v1/Rakefile | 169 +++ .../gapic_metadata.json | 58 + .../google-cloud-datastore-v1.gemspec | 28 + .../lib/google-cloud-datastore-v1.rb | 21 + .../lib/google/cloud/datastore/v1.rb | 45 + .../google/cloud/datastore/v1/datastore.rb | 59 + .../cloud/datastore/v1/datastore/client.rb | 1255 +++++++++++++++++ .../datastore/v1/datastore/credentials.rb | 52 + .../cloud/datastore/v1/datastore/rest.rb | 56 + .../datastore/v1/datastore/rest/client.rb | 1149 +++++++++++++++ .../v1/datastore/rest/service_stub.rb | 549 +++++++ .../lib/google/cloud/datastore/v1/rest.rb | 37 + .../lib/google/cloud/datastore/v1/version.rb | 28 + .../datastore/v1/aggregation_result_pb.rb | 49 + .../lib/google/datastore/v1/datastore_pb.rb | 84 ++ .../datastore/v1/datastore_services_pb.rb | 68 + .../lib/google/datastore/v1/entity_pb.rb | 53 + .../lib/google/datastore/v1/query_pb.rb | 71 + .../google/datastore/v1/query_profile_pb.rb | 51 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 420 ++++++ .../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/datastore/v1/aggregation_result.rb | 74 + .../google/datastore/v1/datastore.rb | 709 ++++++++++ .../proto_docs/google/datastore/v1/entity.rb | 235 +++ .../proto_docs/google/datastore/v1/query.rb | 584 ++++++++ .../google/datastore/v1/query_profile.rb | 98 ++ .../proto_docs/google/protobuf/duration.rb | 98 ++ .../proto_docs/google/protobuf/struct.rb | 96 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 ++ .../proto_docs/google/protobuf/wrappers.rb | 121 ++ .../proto_docs/google/type/latlng.rb | 38 + .../snippets/Gemfile | 32 + .../snippets/datastore/allocate_ids.rb | 47 + .../snippets/datastore/begin_transaction.rb | 47 + .../snippets/datastore/commit.rb | 47 + .../snippets/datastore/lookup.rb | 47 + .../snippets/datastore/reserve_ids.rb | 47 + .../snippets/datastore/rollback.rb | 47 + .../datastore/run_aggregation_query.rb | 47 + .../snippets/datastore/run_query.rb | 47 + .../snippet_metadata_google.datastore.v1.json | 335 +++++ .../cloud/datastore/v1/datastore_rest_test.rb | 550 ++++++++ .../cloud/datastore/v1/datastore_test.rb | 597 ++++++++ .../google-cloud-datastore-v1/test/helper.rb | 25 + 58 files changed, 9836 insertions(+) create mode 100644 owl-bot-staging/google-cloud-datastore-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-datastore-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-datastore-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-datastore-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-datastore-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-datastore-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-datastore-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-datastore-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-datastore-v1/README.md create mode 100644 owl-bot-staging/google-cloud-datastore-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-datastore-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-datastore-v1/google-cloud-datastore-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google-cloud-datastore-v1.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/client.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/credentials.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/aggregation_result_pb.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_pb.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/entity_pb.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_pb.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_profile_pb.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/routing.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/aggregation_result.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/datastore.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/entity.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query_profile.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/type/latlng.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/allocate_ids.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/begin_transaction.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/commit.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/lookup.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/reserve_ids.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/rollback.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_aggregation_query.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_query.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/snippet_metadata_google.datastore.v1.json create mode 100644 owl-bot-staging/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_test.rb create mode 100644 owl-bot-staging/google-cloud-datastore-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-datastore-v1/.gitignore b/owl-bot-staging/google-cloud-datastore-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-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-datastore-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-datastore-v1/.repo-metadata.json new file mode 100644 index 000000000000..9bba836c8677 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "datastore.googleapis.com", + "api_shortname": "datastore", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-datastore-v1/latest", + "distribution_name": "google-cloud-datastore-v1", + "is_cloud": true, + "language": "ruby", + "name": "datastore", + "name_pretty": "Firestore in Datastore mode V1 API", + "product_documentation": "https://cloud.google.com/datastore", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Firestore in Datastore mode is a NoSQL document database built for automatic scaling, high performance, and ease of application development. Note that google-cloud-datastore-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-datastore instead. See the readme for more details.", + "ruby-cloud-env-prefix": "DATASTORE", + "ruby-cloud-product-url": "https://cloud.google.com/datastore", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-datastore-v1/.rubocop.yml b/owl-bot-staging/google-cloud-datastore-v1/.rubocop.yml new file mode 100644 index 000000000000..a97721ccf44b --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-datastore-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-datastore-v1.rb" diff --git a/owl-bot-staging/google-cloud-datastore-v1/.toys.rb b/owl-bot-staging/google-cloud-datastore-v1/.toys.rb new file mode 100644 index 000000000000..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/.yardopts b/owl-bot-staging/google-cloud-datastore-v1/.yardopts new file mode 100644 index 000000000000..7f28ed4699e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Firestore in Datastore mode 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-datastore-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-datastore-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..3101d97ff3de --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-datastore-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-datastore-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/datastore/v1" + +client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/datastore/v1" + +::Google::Cloud::Datastore::V1::Datastore::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Datastore::V1::Datastore::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-datastore-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/datastore/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Datastore::V1::Datastore::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-datastore-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-datastore-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-datastore-v1/Gemfile b/owl-bot-staging/google-cloud-datastore-v1/Gemfile new file mode 100644 index 000000000000..95163a6d11f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.27.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-datastore-v1/LICENSE.md b/owl-bot-staging/google-cloud-datastore-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-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-datastore-v1/README.md b/owl-bot-staging/google-cloud-datastore-v1/README.md new file mode 100644 index 000000000000..cd1bd7f8c09d --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/README.md @@ -0,0 +1,144 @@ +# Ruby Client for the Firestore in Datastore mode V1 API + +Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application. + +Firestore in Datastore mode 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 Firestore in Datastore mode V1 API. Most users should consider using +the main client gem, +[google-cloud-datastore](https://rubygems.org/gems/google-cloud-datastore). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-datastore-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/datastore.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/datastore/v1" + +client = ::Google::Cloud::Datastore::V1::Datastore::Client.new +request = ::Google::Cloud::Datastore::V1::LookupRequest.new # (request fields as keyword arguments...) +response = client.lookup request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-datastore-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/datastore) +for general usage information. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.7+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-datastore`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-datastore-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-datastore`. +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-datastore-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-datastore-v1/Rakefile b/owl-bot-staging/google-cloud-datastore-v1/Rakefile new file mode 100644 index 000000000000..e2fd1bae691f --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-datastore-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["DATASTORE_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["DATASTORE_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["DATASTORE_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 DATASTORE_TEST_PROJECT=test123 DATASTORE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/datastore/v1/datastore/credentials" + ::Google::Cloud::Datastore::V1::Datastore::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["DATASTORE_PROJECT"] = project + ENV["DATASTORE_TEST_PROJECT"] = project + ENV["DATASTORE_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-datastore-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-datastore-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-datastore-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-datastore-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-datastore-v1" + header "google-cloud-datastore-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-datastore-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-datastore-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-datastore-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-datastore-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-datastore-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-datastore-v1/gapic_metadata.json new file mode 100644 index 000000000000..92700b0184ee --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/gapic_metadata.json @@ -0,0 +1,58 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.datastore.v1", + "libraryPackage": "::Google::Cloud::Datastore::V1", + "services": { + "Datastore": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Datastore::V1::Datastore::Client", + "rpcs": { + "Lookup": { + "methods": [ + "lookup" + ] + }, + "RunQuery": { + "methods": [ + "run_query" + ] + }, + "RunAggregationQuery": { + "methods": [ + "run_aggregation_query" + ] + }, + "BeginTransaction": { + "methods": [ + "begin_transaction" + ] + }, + "Commit": { + "methods": [ + "commit" + ] + }, + "Rollback": { + "methods": [ + "rollback" + ] + }, + "AllocateIds": { + "methods": [ + "allocate_ids" + ] + }, + "ReserveIds": { + "methods": [ + "reserve_ids" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-datastore-v1/google-cloud-datastore-v1.gemspec b/owl-bot-staging/google-cloud-datastore-v1/google-cloud-datastore-v1.gemspec new file mode 100644 index 000000000000..cd1f7712098a --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/google-cloud-datastore-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/datastore/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-datastore-v1" + gem.version = Google::Cloud::Datastore::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Firestore in Datastore mode is a NoSQL document database built for automatic scaling, high performance, and ease of application development. Note that google-cloud-datastore-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-datastore instead. See the readme for more details." + gem.summary = "Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 2.7" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google-cloud-datastore-v1.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google-cloud-datastore-v1.rb new file mode 100644 index 000000000000..5818a4440c3a --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google-cloud-datastore-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/datastore/v1" diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1.rb new file mode 100644 index 000000000000..837a9c5b7739 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/datastore/v1/datastore" +require "google/cloud/datastore/v1/version" + +module Google + module Cloud + module Datastore + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/datastore/v1" + # client = ::Google::Cloud::Datastore::V1::Datastore::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/datastore/v1" + # client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/datastore/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore.rb new file mode 100644 index 000000000000..021f80de0d6e --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/datastore/v1/version" + +require "google/cloud/datastore/v1/datastore/credentials" +require "google/cloud/datastore/v1/datastore/client" +require "google/cloud/datastore/v1/datastore/rest" + +module Google + module Cloud + module Datastore + module V1 + ## + # Each RPC normalizes the partition IDs of the keys in its input entities, + # and always returns entities with keys with normalized partition IDs. + # This applies to all keys and entities, including those in values, except keys + # with both an empty path and an empty or unset partition ID. Normalization of + # input keys sets the project ID (if not already set) to the project ID from + # the request. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/datastore/v1/datastore" + # client = ::Google::Cloud::Datastore::V1::Datastore::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/datastore/v1/datastore/rest" + # client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + module Datastore + end + end + end + end +end + +helper_path = ::File.join __dir__, "datastore", "helpers.rb" +require "google/cloud/datastore/v1/datastore/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/client.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/client.rb new file mode 100644 index 000000000000..584ecd373f0d --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/client.rb @@ -0,0 +1,1255 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/datastore/v1/datastore_pb" + +module Google + module Cloud + module Datastore + module V1 + module Datastore + ## + # Client for the Datastore service. + # + # Each RPC normalizes the partition IDs of the keys in its input entities, + # and always returns entities with keys with normalized partition IDs. + # This applies to all keys and entities, including those in values, except keys + # with both an empty path and an empty or unset partition ID. Normalization of + # input keys sets the project ID (if not already set) to the project ID from + # the request. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "datastore.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :datastore_stub + + ## + # Configure the Datastore Client class. + # + # See {::Google::Cloud::Datastore::V1::Datastore::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Datastore clients + # ::Google::Cloud::Datastore::V1::Datastore::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", "Datastore", "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.lookup.timeout = 60.0 + default_config.rpcs.lookup.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.run_query.timeout = 60.0 + default_config.rpcs.run_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.run_aggregation_query.timeout = 60.0 + default_config.rpcs.run_aggregation_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.begin_transaction.timeout = 60.0 + + default_config.rpcs.commit.timeout = 60.0 + + default_config.rpcs.rollback.timeout = 60.0 + + default_config.rpcs.allocate_ids.timeout = 60.0 + + default_config.rpcs.reserve_ids.timeout = 60.0 + default_config.rpcs.reserve_ids.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Datastore 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::Datastore::V1::Datastore::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 + @datastore_stub.universe_domain + end + + ## + # Create a new Datastore client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Datastore::V1::Datastore::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Datastore 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/datastore/v1/datastore_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 + + @datastore_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Datastore::V1::Datastore::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 + ) + end + + # Service calls + + ## + # Looks up entities by key. + # + # @overload lookup(request, options = nil) + # Pass arguments to `lookup` via a request object, either of type + # {::Google::Cloud::Datastore::V1::LookupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::V1::LookupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload lookup(project_id: nil, database_id: nil, read_options: nil, keys: nil, property_mask: nil) + # Pass arguments to `lookup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param read_options [::Google::Cloud::Datastore::V1::ReadOptions, ::Hash] + # The options for this lookup request. + # @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>] + # Required. Keys of entities to look up. + # @param property_mask [::Google::Cloud::Datastore::V1::PropertyMask, ::Hash] + # The properties to return. Defaults to returning all properties. + # + # If this field is set and an entity has a property not referenced in the + # mask, it will be absent from [LookupResponse.found.entity.properties][]. + # + # The entity's key is always returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Datastore::V1::LookupResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Datastore::V1::LookupResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::LookupRequest.new + # + # # Call the lookup method. + # result = client.lookup request + # + # # The returned object is of type Google::Cloud::Datastore::V1::LookupResponse. + # p result + # + def lookup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::V1::LookupRequest + + # Converts hash 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.lookup.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::Datastore::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.project_id && !request.project_id.empty? + header_params["project_id"] = request.project_id + end + if request.database_id && !request.database_id.empty? + header_params["database_id"] = request.database_id + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.lookup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.lookup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @datastore_stub.call_rpc :lookup, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Queries for entities. + # + # @overload run_query(request, options = nil) + # Pass arguments to `run_query` via a request object, either of type + # {::Google::Cloud::Datastore::V1::RunQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, partition_id: nil, read_options: nil, query: nil, gql_query: nil, property_mask: 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 project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param partition_id [::Google::Cloud::Datastore::V1::PartitionId, ::Hash] + # Entities are partitioned into subsets, identified by a partition ID. + # Queries are scoped to a single partition. + # This partition ID is normalized with the standard default context + # partition ID. + # @param read_options [::Google::Cloud::Datastore::V1::ReadOptions, ::Hash] + # The options for this query. + # @param query [::Google::Cloud::Datastore::V1::Query, ::Hash] + # The query to run. + # @param gql_query [::Google::Cloud::Datastore::V1::GqlQuery, ::Hash] + # The GQL query to run. This query must be a non-aggregation query. + # @param property_mask [::Google::Cloud::Datastore::V1::PropertyMask, ::Hash] + # The properties to return. + # This field must not be set for a projection query. + # + # See + # {::Google::Cloud::Datastore::V1::LookupRequest#property_mask LookupRequest.property_mask}. + # @param explain_options [::Google::Cloud::Datastore::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 [::Google::Cloud::Datastore::V1::RunQueryResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Datastore::V1::RunQueryResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::RunQueryRequest.new + # + # # Call the run_query method. + # result = client.run_query request + # + # # The returned object is of type Google::Cloud::Datastore::V1::RunQueryResponse. + # p result + # + def run_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::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::Datastore::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.project_id && !request.project_id.empty? + header_params["project_id"] = request.project_id + end + if request.database_id && !request.database_id.empty? + header_params["database_id"] = request.database_id + end + + request_params_header = URI.encode_www_form header_params + 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 + + @datastore_stub.call_rpc :run_query, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Runs an aggregation query. + # + # @overload run_aggregation_query(request, options = nil) + # Pass arguments to `run_aggregation_query` via a request object, either of type + # {::Google::Cloud::Datastore::V1::RunAggregationQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, partition_id: nil, read_options: nil, aggregation_query: nil, gql_query: 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 project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param partition_id [::Google::Cloud::Datastore::V1::PartitionId, ::Hash] + # Entities are partitioned into subsets, identified by a partition ID. + # Queries are scoped to a single partition. + # This partition ID is normalized with the standard default context + # partition ID. + # @param read_options [::Google::Cloud::Datastore::V1::ReadOptions, ::Hash] + # The options for this query. + # @param aggregation_query [::Google::Cloud::Datastore::V1::AggregationQuery, ::Hash] + # The query to run. + # @param gql_query [::Google::Cloud::Datastore::V1::GqlQuery, ::Hash] + # The GQL query to run. This query must be an aggregation query. + # @param explain_options [::Google::Cloud::Datastore::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 [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new + # + # # Call the run_aggregation_query method. + # result = client.run_aggregation_query request + # + # # The returned object is of type Google::Cloud::Datastore::V1::RunAggregationQueryResponse. + # p result + # + def run_aggregation_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::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::Datastore::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.project_id && !request.project_id.empty? + header_params["project_id"] = request.project_id + end + if request.database_id && !request.database_id.empty? + header_params["database_id"] = request.database_id + end + + request_params_header = URI.encode_www_form header_params + 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 + + @datastore_stub.call_rpc :run_aggregation_query, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins a new transaction. + # + # @overload begin_transaction(request, options = nil) + # Pass arguments to `begin_transaction` via a request object, either of type + # {::Google::Cloud::Datastore::V1::BeginTransactionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, transaction_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 project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param transaction_options [::Google::Cloud::Datastore::V1::TransactionOptions, ::Hash] + # Options for a new transaction. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Datastore::V1::BeginTransactionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Datastore::V1::BeginTransactionResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::BeginTransactionRequest.new + # + # # Call the begin_transaction method. + # result = client.begin_transaction request + # + # # The returned object is of type Google::Cloud::Datastore::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::Datastore::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::Datastore::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.project_id && !request.project_id.empty? + header_params["project_id"] = request.project_id + end + if request.database_id && !request.database_id.empty? + header_params["database_id"] = request.database_id + end + + request_params_header = URI.encode_www_form header_params + 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 + + @datastore_stub.call_rpc :begin_transaction, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Commits a transaction, optionally creating, deleting or modifying some + # entities. + # + # @overload commit(request, options = nil) + # Pass arguments to `commit` via a request object, either of type + # {::Google::Cloud::Datastore::V1::CommitRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, mode: nil, transaction: nil, single_use_transaction: nil, mutations: 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 project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param mode [::Google::Cloud::Datastore::V1::CommitRequest::Mode] + # The type of commit to perform. Defaults to `TRANSACTIONAL`. + # @param transaction [::String] + # The identifier of the transaction associated with the commit. A + # transaction identifier is returned by a call to + # {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}. + # @param single_use_transaction [::Google::Cloud::Datastore::V1::TransactionOptions, ::Hash] + # Options for beginning a new transaction for this request. + # The transaction is committed when the request completes. If specified, + # {::Google::Cloud::Datastore::V1::TransactionOptions TransactionOptions.mode} must be + # {::Google::Cloud::Datastore::V1::TransactionOptions::ReadWrite TransactionOptions.ReadWrite}. + # @param mutations [::Array<::Google::Cloud::Datastore::V1::Mutation, ::Hash>] + # The mutations to perform. + # + # When mode is `TRANSACTIONAL`, mutations affecting a single entity are + # applied in order. The following sequences of mutations affecting a single + # entity are not permitted in a single `Commit` request: + # + # - `insert` followed by `insert` + # - `update` followed by `insert` + # - `upsert` followed by `insert` + # - `delete` followed by `update` + # + # When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + # entity. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Datastore::V1::CommitResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Datastore::V1::CommitResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::CommitRequest.new + # + # # Call the commit method. + # result = client.commit request + # + # # The returned object is of type Google::Cloud::Datastore::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::Datastore::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::Datastore::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.project_id && !request.project_id.empty? + header_params["project_id"] = request.project_id + end + if request.database_id && !request.database_id.empty? + header_params["database_id"] = request.database_id + end + + request_params_header = URI.encode_www_form header_params + 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 + + @datastore_stub.call_rpc :commit, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Rolls back a transaction. + # + # @overload rollback(request, options = nil) + # Pass arguments to `rollback` via a request object, either of type + # {::Google::Cloud::Datastore::V1::RollbackRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: 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 project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param transaction [::String] + # Required. The transaction identifier, returned by a call to + # {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Datastore::V1::RollbackResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Datastore::V1::RollbackResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::RollbackRequest.new + # + # # Call the rollback method. + # result = client.rollback request + # + # # The returned object is of type Google::Cloud::Datastore::V1::RollbackResponse. + # p result + # + def rollback request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::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::Datastore::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.project_id && !request.project_id.empty? + header_params["project_id"] = request.project_id + end + if request.database_id && !request.database_id.empty? + header_params["database_id"] = request.database_id + end + + request_params_header = URI.encode_www_form header_params + 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 + + @datastore_stub.call_rpc :rollback, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Allocates IDs for the given keys, which is useful for referencing an entity + # before it is inserted. + # + # @overload allocate_ids(request, options = nil) + # Pass arguments to `allocate_ids` via a request object, either of type + # {::Google::Cloud::Datastore::V1::AllocateIdsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::V1::AllocateIdsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload allocate_ids(project_id: nil, database_id: nil, keys: nil) + # Pass arguments to `allocate_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 project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>] + # Required. A list of keys with incomplete key paths for which to allocate + # IDs. No key may be reserved/read-only. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Datastore::V1::AllocateIdsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Datastore::V1::AllocateIdsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::AllocateIdsRequest.new + # + # # Call the allocate_ids method. + # result = client.allocate_ids request + # + # # The returned object is of type Google::Cloud::Datastore::V1::AllocateIdsResponse. + # p result + # + def allocate_ids request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::V1::AllocateIdsRequest + + # Converts hash 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.allocate_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::Datastore::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.project_id && !request.project_id.empty? + header_params["project_id"] = request.project_id + end + if request.database_id && !request.database_id.empty? + header_params["database_id"] = request.database_id + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.allocate_ids.timeout, + metadata: metadata, + retry_policy: @config.rpcs.allocate_ids.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @datastore_stub.call_rpc :allocate_ids, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Prevents the supplied keys' IDs from being auto-allocated by Cloud + # Datastore. + # + # @overload reserve_ids(request, options = nil) + # Pass arguments to `reserve_ids` via a request object, either of type + # {::Google::Cloud::Datastore::V1::ReserveIdsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::V1::ReserveIdsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reserve_ids(project_id: nil, database_id: nil, keys: nil) + # Pass arguments to `reserve_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 project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>] + # Required. A list of keys with complete key paths whose numeric IDs should + # not be auto-allocated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Datastore::V1::ReserveIdsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Datastore::V1::ReserveIdsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::ReserveIdsRequest.new + # + # # Call the reserve_ids method. + # result = client.reserve_ids request + # + # # The returned object is of type Google::Cloud::Datastore::V1::ReserveIdsResponse. + # p result + # + def reserve_ids request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::V1::ReserveIdsRequest + + # Converts hash 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.reserve_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::Datastore::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.project_id && !request.project_id.empty? + header_params["project_id"] = request.project_id + end + if request.database_id && !request.database_id.empty? + header_params["database_id"] = request.database_id + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.reserve_ids.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reserve_ids.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @datastore_stub.call_rpc :reserve_ids, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Datastore API. + # + # This class represents the configuration for Datastore, + # 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::Datastore::V1::Datastore::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 + # # lookup to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Datastore::V1::Datastore::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.lookup.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.lookup.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "datastore.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Datastore 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 `lookup` + # @return [::Gapic::Config::Method] + # + attr_reader :lookup + ## + # RPC-specific configuration for `run_query` + # @return [::Gapic::Config::Method] + # + attr_reader :run_query + ## + # RPC-specific configuration for `run_aggregation_query` + # @return [::Gapic::Config::Method] + # + attr_reader :run_aggregation_query + ## + # 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 `allocate_ids` + # @return [::Gapic::Config::Method] + # + attr_reader :allocate_ids + ## + # RPC-specific configuration for `reserve_ids` + # @return [::Gapic::Config::Method] + # + attr_reader :reserve_ids + + # @private + def initialize parent_rpcs = nil + lookup_config = parent_rpcs.lookup if parent_rpcs.respond_to? :lookup + @lookup = ::Gapic::Config::Method.new lookup_config + run_query_config = parent_rpcs.run_query if parent_rpcs.respond_to? :run_query + @run_query = ::Gapic::Config::Method.new run_query_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 + 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 + allocate_ids_config = parent_rpcs.allocate_ids if parent_rpcs.respond_to? :allocate_ids + @allocate_ids = ::Gapic::Config::Method.new allocate_ids_config + reserve_ids_config = parent_rpcs.reserve_ids if parent_rpcs.respond_to? :reserve_ids + @reserve_ids = ::Gapic::Config::Method.new reserve_ids_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/credentials.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/credentials.rb new file mode 100644 index 000000000000..11b6c778cf7b --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Datastore + module V1 + module Datastore + # Credentials for the Datastore API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/datastore" + ] + self.env_vars = [ + "DATASTORE_CREDENTIALS", + "DATASTORE_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DATASTORE_CREDENTIALS_JSON", + "DATASTORE_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-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest.rb new file mode 100644 index 000000000000..9ddabd458851 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/datastore/v1/version" + +require "google/cloud/datastore/v1/datastore/credentials" +require "google/cloud/datastore/v1/datastore/rest/client" + +module Google + module Cloud + module Datastore + module V1 + ## + # Each RPC normalizes the partition IDs of the keys in its input entities, + # and always returns entities with keys with normalized partition IDs. + # This applies to all keys and entities, including those in values, except keys + # with both an empty path and an empty or unset partition ID. Normalization of + # input keys sets the project ID (if not already set) to the project ID from + # the request. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/datastore/v1/datastore/rest" + # client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + module Datastore + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/datastore/v1/datastore/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/client.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/client.rb new file mode 100644 index 000000000000..6d753e2815f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/client.rb @@ -0,0 +1,1149 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/datastore/v1/datastore_pb" +require "google/cloud/datastore/v1/datastore/rest/service_stub" + +module Google + module Cloud + module Datastore + module V1 + module Datastore + module Rest + ## + # REST client for the Datastore service. + # + # Each RPC normalizes the partition IDs of the keys in its input entities, + # and always returns entities with keys with normalized partition IDs. + # This applies to all keys and entities, including those in values, except keys + # with both an empty path and an empty or unset partition ID. Normalization of + # input keys sets the project ID (if not already set) to the project ID from + # the request. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "datastore.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :datastore_stub + + ## + # Configure the Datastore Client class. + # + # See {::Google::Cloud::Datastore::V1::Datastore::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Datastore clients + # ::Google::Cloud::Datastore::V1::Datastore::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", "Datastore", "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.lookup.timeout = 60.0 + default_config.rpcs.lookup.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.run_query.timeout = 60.0 + default_config.rpcs.run_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.run_aggregation_query.timeout = 60.0 + default_config.rpcs.run_aggregation_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.begin_transaction.timeout = 60.0 + + default_config.rpcs.commit.timeout = 60.0 + + default_config.rpcs.rollback.timeout = 60.0 + + default_config.rpcs.allocate_ids.timeout = 60.0 + + default_config.rpcs.reserve_ids.timeout = 60.0 + default_config.rpcs.reserve_ids.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Datastore 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::Datastore::V1::Datastore::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 + @datastore_stub.universe_domain + end + + ## + # Create a new Datastore REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Datastore 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 + + @datastore_stub = ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + end + + # Service calls + + ## + # Looks up entities by key. + # + # @overload lookup(request, options = nil) + # Pass arguments to `lookup` via a request object, either of type + # {::Google::Cloud::Datastore::V1::LookupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::V1::LookupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload lookup(project_id: nil, database_id: nil, read_options: nil, keys: nil, property_mask: nil) + # Pass arguments to `lookup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param read_options [::Google::Cloud::Datastore::V1::ReadOptions, ::Hash] + # The options for this lookup request. + # @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>] + # Required. Keys of entities to look up. + # @param property_mask [::Google::Cloud::Datastore::V1::PropertyMask, ::Hash] + # The properties to return. Defaults to returning all properties. + # + # If this field is set and an entity has a property not referenced in the + # mask, it will be absent from [LookupResponse.found.entity.properties][]. + # + # The entity's key is always returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Datastore::V1::LookupResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::V1::LookupResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::LookupRequest.new + # + # # Call the lookup method. + # result = client.lookup request + # + # # The returned object is of type Google::Cloud::Datastore::V1::LookupResponse. + # p result + # + def lookup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::V1::LookupRequest + + # Converts hash 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.lookup.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::Datastore::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.lookup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.lookup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @datastore_stub.lookup request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Queries for entities. + # + # @overload run_query(request, options = nil) + # Pass arguments to `run_query` via a request object, either of type + # {::Google::Cloud::Datastore::V1::RunQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, partition_id: nil, read_options: nil, query: nil, gql_query: nil, property_mask: 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 project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param partition_id [::Google::Cloud::Datastore::V1::PartitionId, ::Hash] + # Entities are partitioned into subsets, identified by a partition ID. + # Queries are scoped to a single partition. + # This partition ID is normalized with the standard default context + # partition ID. + # @param read_options [::Google::Cloud::Datastore::V1::ReadOptions, ::Hash] + # The options for this query. + # @param query [::Google::Cloud::Datastore::V1::Query, ::Hash] + # The query to run. + # @param gql_query [::Google::Cloud::Datastore::V1::GqlQuery, ::Hash] + # The GQL query to run. This query must be a non-aggregation query. + # @param property_mask [::Google::Cloud::Datastore::V1::PropertyMask, ::Hash] + # The properties to return. + # This field must not be set for a projection query. + # + # See + # {::Google::Cloud::Datastore::V1::LookupRequest#property_mask LookupRequest.property_mask}. + # @param explain_options [::Google::Cloud::Datastore::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 [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Datastore::V1::RunQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::V1::RunQueryResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::RunQueryRequest.new + # + # # Call the run_query method. + # result = client.run_query request + # + # # The returned object is of type Google::Cloud::Datastore::V1::RunQueryResponse. + # p result + # + def run_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::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::Datastore::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 + + @datastore_stub.run_query request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Runs an aggregation query. + # + # @overload run_aggregation_query(request, options = nil) + # Pass arguments to `run_aggregation_query` via a request object, either of type + # {::Google::Cloud::Datastore::V1::RunAggregationQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, partition_id: nil, read_options: nil, aggregation_query: nil, gql_query: 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 project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param partition_id [::Google::Cloud::Datastore::V1::PartitionId, ::Hash] + # Entities are partitioned into subsets, identified by a partition ID. + # Queries are scoped to a single partition. + # This partition ID is normalized with the standard default context + # partition ID. + # @param read_options [::Google::Cloud::Datastore::V1::ReadOptions, ::Hash] + # The options for this query. + # @param aggregation_query [::Google::Cloud::Datastore::V1::AggregationQuery, ::Hash] + # The query to run. + # @param gql_query [::Google::Cloud::Datastore::V1::GqlQuery, ::Hash] + # The GQL query to run. This query must be an aggregation query. + # @param explain_options [::Google::Cloud::Datastore::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 [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new + # + # # Call the run_aggregation_query method. + # result = client.run_aggregation_query request + # + # # The returned object is of type Google::Cloud::Datastore::V1::RunAggregationQueryResponse. + # p result + # + def run_aggregation_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::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::Datastore::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 + + @datastore_stub.run_aggregation_query request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins a new transaction. + # + # @overload begin_transaction(request, options = nil) + # Pass arguments to `begin_transaction` via a request object, either of type + # {::Google::Cloud::Datastore::V1::BeginTransactionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, transaction_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 project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param transaction_options [::Google::Cloud::Datastore::V1::TransactionOptions, ::Hash] + # Options for a new transaction. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Datastore::V1::BeginTransactionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::V1::BeginTransactionResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::BeginTransactionRequest.new + # + # # Call the begin_transaction method. + # result = client.begin_transaction request + # + # # The returned object is of type Google::Cloud::Datastore::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::Datastore::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::Datastore::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 + + @datastore_stub.begin_transaction request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Commits a transaction, optionally creating, deleting or modifying some + # entities. + # + # @overload commit(request, options = nil) + # Pass arguments to `commit` via a request object, either of type + # {::Google::Cloud::Datastore::V1::CommitRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, mode: nil, transaction: nil, single_use_transaction: nil, mutations: 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 project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param mode [::Google::Cloud::Datastore::V1::CommitRequest::Mode] + # The type of commit to perform. Defaults to `TRANSACTIONAL`. + # @param transaction [::String] + # The identifier of the transaction associated with the commit. A + # transaction identifier is returned by a call to + # {::Google::Cloud::Datastore::V1::Datastore::Rest::Client#begin_transaction Datastore.BeginTransaction}. + # @param single_use_transaction [::Google::Cloud::Datastore::V1::TransactionOptions, ::Hash] + # Options for beginning a new transaction for this request. + # The transaction is committed when the request completes. If specified, + # {::Google::Cloud::Datastore::V1::TransactionOptions TransactionOptions.mode} must be + # {::Google::Cloud::Datastore::V1::TransactionOptions::ReadWrite TransactionOptions.ReadWrite}. + # @param mutations [::Array<::Google::Cloud::Datastore::V1::Mutation, ::Hash>] + # The mutations to perform. + # + # When mode is `TRANSACTIONAL`, mutations affecting a single entity are + # applied in order. The following sequences of mutations affecting a single + # entity are not permitted in a single `Commit` request: + # + # - `insert` followed by `insert` + # - `update` followed by `insert` + # - `upsert` followed by `insert` + # - `delete` followed by `update` + # + # When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + # entity. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Datastore::V1::CommitResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::V1::CommitResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::CommitRequest.new + # + # # Call the commit method. + # result = client.commit request + # + # # The returned object is of type Google::Cloud::Datastore::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::Datastore::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::Datastore::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 + + @datastore_stub.commit request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Rolls back a transaction. + # + # @overload rollback(request, options = nil) + # Pass arguments to `rollback` via a request object, either of type + # {::Google::Cloud::Datastore::V1::RollbackRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: 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 project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param transaction [::String] + # Required. The transaction identifier, returned by a call to + # {::Google::Cloud::Datastore::V1::Datastore::Rest::Client#begin_transaction Datastore.BeginTransaction}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Datastore::V1::RollbackResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::V1::RollbackResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::RollbackRequest.new + # + # # Call the rollback method. + # result = client.rollback request + # + # # The returned object is of type Google::Cloud::Datastore::V1::RollbackResponse. + # p result + # + def rollback request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::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::Datastore::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 + + @datastore_stub.rollback request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Allocates IDs for the given keys, which is useful for referencing an entity + # before it is inserted. + # + # @overload allocate_ids(request, options = nil) + # Pass arguments to `allocate_ids` via a request object, either of type + # {::Google::Cloud::Datastore::V1::AllocateIdsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::V1::AllocateIdsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload allocate_ids(project_id: nil, database_id: nil, keys: nil) + # Pass arguments to `allocate_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 project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>] + # Required. A list of keys with incomplete key paths for which to allocate + # IDs. No key may be reserved/read-only. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Datastore::V1::AllocateIdsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::V1::AllocateIdsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::AllocateIdsRequest.new + # + # # Call the allocate_ids method. + # result = client.allocate_ids request + # + # # The returned object is of type Google::Cloud::Datastore::V1::AllocateIdsResponse. + # p result + # + def allocate_ids request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::V1::AllocateIdsRequest + + # Converts hash 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.allocate_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::Datastore::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.allocate_ids.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.allocate_ids.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @datastore_stub.allocate_ids request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Prevents the supplied keys' IDs from being auto-allocated by Cloud + # Datastore. + # + # @overload reserve_ids(request, options = nil) + # Pass arguments to `reserve_ids` via a request object, either of type + # {::Google::Cloud::Datastore::V1::ReserveIdsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Datastore::V1::ReserveIdsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload reserve_ids(project_id: nil, database_id: nil, keys: nil) + # Pass arguments to `reserve_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 project_id [::String] + # Required. The ID of the project against which to make the request. + # @param database_id [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>] + # Required. A list of keys with complete key paths whose numeric IDs should + # not be auto-allocated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Datastore::V1::ReserveIdsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::V1::ReserveIdsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::ReserveIdsRequest.new + # + # # Call the reserve_ids method. + # result = client.reserve_ids request + # + # # The returned object is of type Google::Cloud::Datastore::V1::ReserveIdsResponse. + # p result + # + def reserve_ids request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::V1::ReserveIdsRequest + + # Converts hash 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.reserve_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::Datastore::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.reserve_ids.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.reserve_ids.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @datastore_stub.reserve_ids request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Datastore REST API. + # + # This class represents the configuration for Datastore 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::Datastore::V1::Datastore::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 + # # lookup to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.lookup.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.lookup.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "datastore.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Datastore 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 `lookup` + # @return [::Gapic::Config::Method] + # + attr_reader :lookup + ## + # RPC-specific configuration for `run_query` + # @return [::Gapic::Config::Method] + # + attr_reader :run_query + ## + # RPC-specific configuration for `run_aggregation_query` + # @return [::Gapic::Config::Method] + # + attr_reader :run_aggregation_query + ## + # 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 `allocate_ids` + # @return [::Gapic::Config::Method] + # + attr_reader :allocate_ids + ## + # RPC-specific configuration for `reserve_ids` + # @return [::Gapic::Config::Method] + # + attr_reader :reserve_ids + + # @private + def initialize parent_rpcs = nil + lookup_config = parent_rpcs.lookup if parent_rpcs.respond_to? :lookup + @lookup = ::Gapic::Config::Method.new lookup_config + run_query_config = parent_rpcs.run_query if parent_rpcs.respond_to? :run_query + @run_query = ::Gapic::Config::Method.new run_query_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 + 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 + allocate_ids_config = parent_rpcs.allocate_ids if parent_rpcs.respond_to? :allocate_ids + @allocate_ids = ::Gapic::Config::Method.new allocate_ids_config + reserve_ids_config = parent_rpcs.reserve_ids if parent_rpcs.respond_to? :reserve_ids + @reserve_ids = ::Gapic::Config::Method.new reserve_ids_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/service_stub.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/service_stub.rb new file mode 100644 index 000000000000..3c0106796b80 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/service_stub.rb @@ -0,0 +1,549 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/datastore/v1/datastore_pb" + +module Google + module Cloud + module Datastore + module V1 + module Datastore + module Rest + ## + # REST service stub for the Datastore service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # Baseline implementation for the lookup REST call + # + # @param request_pb [::Google::Cloud::Datastore::V1::LookupRequest] + # 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::Datastore::V1::LookupResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::V1::LookupResponse] + # A result object deserialized from the server's reply + def lookup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_lookup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Datastore::V1::LookupResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the run_query REST call + # + # @param request_pb [::Google::Cloud::Datastore::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. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Datastore::V1::RunQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::V1::RunQueryResponse] + # A result object deserialized from the server's reply + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Datastore::V1::RunQueryResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the run_aggregation_query REST call + # + # @param request_pb [::Google::Cloud::Datastore::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. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse] + # A result object deserialized from the server's reply + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Datastore::V1::RunAggregationQueryResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the begin_transaction REST call + # + # @param request_pb [::Google::Cloud::Datastore::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::Datastore::V1::BeginTransactionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Datastore::V1::BeginTransactionResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the commit REST call + # + # @param request_pb [::Google::Cloud::Datastore::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::Datastore::V1::CommitResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Datastore::V1::CommitResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the rollback REST call + # + # @param request_pb [::Google::Cloud::Datastore::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::Cloud::Datastore::V1::RollbackResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::V1::RollbackResponse] + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Datastore::V1::RollbackResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the allocate_ids REST call + # + # @param request_pb [::Google::Cloud::Datastore::V1::AllocateIdsRequest] + # 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::Datastore::V1::AllocateIdsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::V1::AllocateIdsResponse] + # A result object deserialized from the server's reply + def allocate_ids request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_allocate_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Datastore::V1::AllocateIdsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the reserve_ids REST call + # + # @param request_pb [::Google::Cloud::Datastore::V1::ReserveIdsRequest] + # 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::Datastore::V1::ReserveIdsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Datastore::V1::ReserveIdsResponse] + # A result object deserialized from the server's reply + def reserve_ids request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_reserve_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Datastore::V1::ReserveIdsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the lookup REST call + # + # @param request_pb [::Google::Cloud::Datastore::V1::LookupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_lookup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/projects/{project_id}:lookup", + body: "*", + matches: [ + ["project_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_query REST call + # + # @param request_pb [::Google::Cloud::Datastore::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/projects/{project_id}:runQuery", + body: "*", + matches: [ + ["project_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_aggregation_query REST call + # + # @param request_pb [::Google::Cloud::Datastore::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/projects/{project_id}:runAggregationQuery", + body: "*", + matches: [ + ["project_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the begin_transaction REST call + # + # @param request_pb [::Google::Cloud::Datastore::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/projects/{project_id}:beginTransaction", + body: "*", + matches: [ + ["project_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the commit REST call + # + # @param request_pb [::Google::Cloud::Datastore::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/projects/{project_id}:commit", + body: "*", + matches: [ + ["project_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the rollback REST call + # + # @param request_pb [::Google::Cloud::Datastore::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/projects/{project_id}:rollback", + body: "*", + matches: [ + ["project_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the allocate_ids REST call + # + # @param request_pb [::Google::Cloud::Datastore::V1::AllocateIdsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_allocate_ids_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/projects/{project_id}:allocateIds", + body: "*", + matches: [ + ["project_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the reserve_ids REST call + # + # @param request_pb [::Google::Cloud::Datastore::V1::ReserveIdsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_reserve_ids_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/projects/{project_id}:reserveIds", + body: "*", + matches: [ + ["project_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/rest.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/rest.rb new file mode 100644 index 000000000000..59b837e1a537 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/rest.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/datastore/v1/datastore/rest" +require "google/cloud/datastore/v1/version" + +module Google + module Cloud + module Datastore + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/datastore/v1/rest" + # client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/version.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/version.rb new file mode 100644 index 000000000000..66fdb773219e --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Datastore + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/aggregation_result_pb.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/aggregation_result_pb.rb new file mode 100644 index 000000000000..fdcef6dd2696 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/aggregation_result_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/datastore/v1/aggregation_result.proto + +require 'google/protobuf' + +require 'google/datastore/v1/entity_pb' +require 'google/datastore/v1/query_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/datastore/v1/aggregation_result.proto\x12\x13google.datastore.v1\x1a google/datastore/v1/entity.proto\x1a\x1fgoogle/datastore/v1/query.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xca\x01\n\x11\x41ggregationResult\x12]\n\x14\x61ggregate_properties\x18\x02 \x03(\x0b\x32?.google.datastore.v1.AggregationResult.AggregatePropertiesEntry\x1aV\n\x18\x41ggregatePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.datastore.v1.Value:\x02\x38\x01\"\xd9\x01\n\x16\x41ggregationResultBatch\x12\x43\n\x13\x61ggregation_results\x18\x01 \x03(\x0b\x32&.google.datastore.v1.AggregationResult\x12K\n\x0cmore_results\x18\x02 \x01(\x0e\x32\x35.google.datastore.v1.QueryResultBatch.MoreResultsType\x12-\n\tread_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xc7\x01\n\x17\x63om.google.datastore.v1B\x16\x41ggregationResultProtoP\x01Z;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb\xaa\x02\x19Google.Cloud.Datastore.V1\xca\x02\x19Google\\Cloud\\Datastore\\V1\xea\x02\x1cGoogle::Cloud::Datastore::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.datastore.v1.Value", "google/datastore/v1/entity.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Datastore + module V1 + AggregationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationResult").msgclass + AggregationResultBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationResultBatch").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_pb.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_pb.rb new file mode 100644 index 000000000000..6d65402143eb --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_pb.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/datastore/v1/datastore.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/datastore/v1/aggregation_result_pb' +require 'google/datastore/v1/entity_pb' +require 'google/datastore/v1/query_pb' +require 'google/datastore/v1/query_profile_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n#google/datastore/v1/datastore.proto\x12\x13google.datastore.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x18google/api/routing.proto\x1a,google/datastore/v1/aggregation_result.proto\x1a google/datastore/v1/entity.proto\x1a\x1fgoogle/datastore/v1/query.proto\x1a\'google/datastore/v1/query_profile.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdc\x01\n\rLookupRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x36\n\x0cread_options\x18\x01 \x01(\x0b\x32 .google.datastore.v1.ReadOptions\x12+\n\x04keys\x18\x03 \x03(\x0b\x32\x18.google.datastore.v1.KeyB\x03\xe0\x41\x02\x12\x38\n\rproperty_mask\x18\x05 \x01(\x0b\x32!.google.datastore.v1.PropertyMask\"\xe6\x01\n\x0eLookupResponse\x12\x30\n\x05\x66ound\x18\x01 \x03(\x0b\x32!.google.datastore.v1.EntityResult\x12\x32\n\x07missing\x18\x02 \x03(\x0b\x32!.google.datastore.v1.EntityResult\x12*\n\x08\x64\x65\x66\x65rred\x18\x03 \x03(\x0b\x32\x18.google.datastore.v1.Key\x12\x13\n\x0btransaction\x18\x05 \x01(\x0c\x12-\n\tread_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x9b\x03\n\x0fRunQueryRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x36\n\x0cpartition_id\x18\x02 \x01(\x0b\x32 .google.datastore.v1.PartitionId\x12\x36\n\x0cread_options\x18\x01 \x01(\x0b\x32 .google.datastore.v1.ReadOptions\x12+\n\x05query\x18\x03 \x01(\x0b\x32\x1a.google.datastore.v1.QueryH\x00\x12\x32\n\tgql_query\x18\x07 \x01(\x0b\x32\x1d.google.datastore.v1.GqlQueryH\x00\x12\x38\n\rproperty_mask\x18\n \x01(\x0b\x32!.google.datastore.v1.PropertyMask\x12\x41\n\x0f\x65xplain_options\x18\x0c \x01(\x0b\x32#.google.datastore.v1.ExplainOptionsB\x03\xe0\x41\x01\x42\x0c\n\nquery_type\"\xc6\x01\n\x10RunQueryResponse\x12\x34\n\x05\x62\x61tch\x18\x01 \x01(\x0b\x32%.google.datastore.v1.QueryResultBatch\x12)\n\x05query\x18\x02 \x01(\x0b\x32\x1a.google.datastore.v1.Query\x12\x13\n\x0btransaction\x18\x05 \x01(\x0c\x12<\n\x0f\x65xplain_metrics\x18\t \x01(\x0b\x32#.google.datastore.v1.ExplainMetrics\"\x83\x03\n\x1aRunAggregationQueryRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x36\n\x0cpartition_id\x18\x02 \x01(\x0b\x32 .google.datastore.v1.PartitionId\x12\x36\n\x0cread_options\x18\x01 \x01(\x0b\x32 .google.datastore.v1.ReadOptions\x12\x42\n\x11\x61ggregation_query\x18\x03 \x01(\x0b\x32%.google.datastore.v1.AggregationQueryH\x00\x12\x32\n\tgql_query\x18\x07 \x01(\x0b\x32\x1d.google.datastore.v1.GqlQueryH\x00\x12\x41\n\x0f\x65xplain_options\x18\x0b \x01(\x0b\x32#.google.datastore.v1.ExplainOptionsB\x03\xe0\x41\x01\x42\x0c\n\nquery_type\"\xe2\x01\n\x1bRunAggregationQueryResponse\x12:\n\x05\x62\x61tch\x18\x01 \x01(\x0b\x32+.google.datastore.v1.AggregationResultBatch\x12\x34\n\x05query\x18\x02 \x01(\x0b\x32%.google.datastore.v1.AggregationQuery\x12\x13\n\x0btransaction\x18\x05 \x01(\x0c\x12<\n\x0f\x65xplain_metrics\x18\t \x01(\x0b\x32#.google.datastore.v1.ExplainMetrics\"\x8d\x01\n\x17\x42\x65ginTransactionRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x44\n\x13transaction_options\x18\n \x01(\x0b\x32\'.google.datastore.v1.TransactionOptions\"/\n\x18\x42\x65ginTransactionResponse\x12\x13\n\x0btransaction\x18\x01 \x01(\x0c\"Y\n\x0fRollbackRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x18\n\x0btransaction\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\"\x12\n\x10RollbackResponse\"\xe8\x02\n\rCommitRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x35\n\x04mode\x18\x05 \x01(\x0e\x32\'.google.datastore.v1.CommitRequest.Mode\x12\x15\n\x0btransaction\x18\x01 \x01(\x0cH\x00\x12I\n\x16single_use_transaction\x18\n \x01(\x0b\x32\'.google.datastore.v1.TransactionOptionsH\x00\x12\x30\n\tmutations\x18\x06 \x03(\x0b\x32\x1d.google.datastore.v1.Mutation\"F\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x11\n\rTRANSACTIONAL\x10\x01\x12\x15\n\x11NON_TRANSACTIONAL\x10\x02\x42\x16\n\x14transaction_selector\"\x97\x01\n\x0e\x43ommitResponse\x12=\n\x10mutation_results\x18\x03 \x03(\x0b\x32#.google.datastore.v1.MutationResult\x12\x15\n\rindex_updates\x18\x04 \x01(\x05\x12/\n\x0b\x63ommit_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"o\n\x12\x41llocateIdsRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12+\n\x04keys\x18\x01 \x03(\x0b\x32\x18.google.datastore.v1.KeyB\x03\xe0\x41\x02\"=\n\x13\x41llocateIdsResponse\x12&\n\x04keys\x18\x01 \x03(\x0b\x32\x18.google.datastore.v1.Key\"n\n\x11ReserveIdsRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12+\n\x04keys\x18\x01 \x03(\x0b\x32\x18.google.datastore.v1.KeyB\x03\xe0\x41\x02\"\x14\n\x12ReserveIdsResponse\"\xf2\x04\n\x08Mutation\x12-\n\x06insert\x18\x04 \x01(\x0b\x32\x1b.google.datastore.v1.EntityH\x00\x12-\n\x06update\x18\x05 \x01(\x0b\x32\x1b.google.datastore.v1.EntityH\x00\x12-\n\x06upsert\x18\x06 \x01(\x0b\x32\x1b.google.datastore.v1.EntityH\x00\x12*\n\x06\x64\x65lete\x18\x07 \x01(\x0b\x32\x18.google.datastore.v1.KeyH\x00\x12\x16\n\x0c\x62\x61se_version\x18\x08 \x01(\x03H\x01\x12\x31\n\x0bupdate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12^\n\x1c\x63onflict_resolution_strategy\x18\n \x01(\x0e\x32\x38.google.datastore.v1.Mutation.ConflictResolutionStrategy\x12\x38\n\rproperty_mask\x18\t \x01(\x0b\x32!.google.datastore.v1.PropertyMask\x12H\n\x13property_transforms\x18\x0c \x03(\x0b\x32&.google.datastore.v1.PropertyTransformB\x03\xe0\x41\x01\"R\n\x1a\x43onflictResolutionStrategy\x12\x18\n\x14STRATEGY_UNSPECIFIED\x10\x00\x12\x10\n\x0cSERVER_VALUE\x10\x01\x12\x08\n\x04\x46\x41IL\x10\x03\x42\x0b\n\toperationB\x1d\n\x1b\x63onflict_detection_strategy\"\xe3\x03\n\x11PropertyTransform\x12\x15\n\x08property\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12Q\n\x13set_to_server_value\x18\x02 \x01(\x0e\x32\x32.google.datastore.v1.PropertyTransform.ServerValueH\x00\x12/\n\tincrement\x18\x03 \x01(\x0b\x32\x1a.google.datastore.v1.ValueH\x00\x12-\n\x07maximum\x18\x04 \x01(\x0b\x32\x1a.google.datastore.v1.ValueH\x00\x12-\n\x07minimum\x18\x05 \x01(\x0b\x32\x1a.google.datastore.v1.ValueH\x00\x12\x42\n\x17\x61ppend_missing_elements\x18\x06 \x01(\x0b\x32\x1f.google.datastore.v1.ArrayValueH\x00\x12@\n\x15remove_all_from_array\x18\x07 \x01(\x0b\x32\x1f.google.datastore.v1.ArrayValueH\x00\"=\n\x0bServerValue\x12\x1c\n\x18SERVER_VALUE_UNSPECIFIED\x10\x00\x12\x10\n\x0cREQUEST_TIME\x10\x01\x42\x10\n\x0etransform_type\"\xfc\x01\n\x0eMutationResult\x12%\n\x03key\x18\x03 \x01(\x0b\x32\x18.google.datastore.v1.Key\x12\x0f\n\x07version\x18\x04 \x01(\x03\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x19\n\x11\x63onflict_detected\x18\x05 \x01(\x08\x12\x35\n\x11transform_results\x18\x08 \x03(\x0b\x32\x1a.google.datastore.v1.Value\"\x1d\n\x0cPropertyMask\x12\r\n\x05paths\x18\x01 \x03(\t\"\xca\x02\n\x0bReadOptions\x12L\n\x10read_consistency\x18\x01 \x01(\x0e\x32\x30.google.datastore.v1.ReadOptions.ReadConsistencyH\x00\x12\x15\n\x0btransaction\x18\x02 \x01(\x0cH\x00\x12\x42\n\x0fnew_transaction\x18\x03 \x01(\x0b\x32\'.google.datastore.v1.TransactionOptionsH\x00\x12/\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\"M\n\x0fReadConsistency\x12 \n\x1cREAD_CONSISTENCY_UNSPECIFIED\x10\x00\x12\n\n\x06STRONG\x10\x01\x12\x0c\n\x08\x45VENTUAL\x10\x02\x42\x12\n\x10\x63onsistency_type\"\x92\x02\n\x12TransactionOptions\x12G\n\nread_write\x18\x01 \x01(\x0b\x32\x31.google.datastore.v1.TransactionOptions.ReadWriteH\x00\x12\x45\n\tread_only\x18\x02 \x01(\x0b\x32\x30.google.datastore.v1.TransactionOptions.ReadOnlyH\x00\x1a)\n\tReadWrite\x12\x1c\n\x14previous_transaction\x18\x01 \x01(\x0c\x1a\x39\n\x08ReadOnly\x12-\n\tread_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\n\x04mode2\xe1\r\n\tDatastore\x12\xc0\x01\n\x06Lookup\x12\".google.datastore.v1.LookupRequest\x1a#.google.datastore.v1.LookupResponse\"m\xda\x41\x1cproject_id,read_options,keys\x82\xd3\xe4\x93\x02%\" /v1/projects/{project_id}:lookup:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xa9\x01\n\x08RunQuery\x12$.google.datastore.v1.RunQueryRequest\x1a%.google.datastore.v1.RunQueryResponse\"P\x82\xd3\xe4\x93\x02\'\"\"/v1/projects/{project_id}:runQuery:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xd5\x01\n\x13RunAggregationQuery\x12/.google.datastore.v1.RunAggregationQueryRequest\x1a\x30.google.datastore.v1.RunAggregationQueryResponse\"[\x82\xd3\xe4\x93\x02\x32\"-/v1/projects/{project_id}:runAggregationQuery:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xd6\x01\n\x10\x42\x65ginTransaction\x12,.google.datastore.v1.BeginTransactionRequest\x1a-.google.datastore.v1.BeginTransactionResponse\"e\xda\x41\nproject_id\x82\xd3\xe4\x93\x02/\"*/v1/projects/{project_id}:beginTransaction:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xe6\x01\n\x06\x43ommit\x12\".google.datastore.v1.CommitRequest\x1a#.google.datastore.v1.CommitResponse\"\x92\x01\xda\x41%project_id,mode,transaction,mutations\xda\x41\x19project_id,mode,mutations\x82\xd3\xe4\x93\x02%\" /v1/projects/{project_id}:commit:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xc2\x01\n\x08Rollback\x12$.google.datastore.v1.RollbackRequest\x1a%.google.datastore.v1.RollbackResponse\"i\xda\x41\x16project_id,transaction\x82\xd3\xe4\x93\x02\'\"\"/v1/projects/{project_id}:rollback:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xc7\x01\n\x0b\x41llocateIds\x12\'.google.datastore.v1.AllocateIdsRequest\x1a(.google.datastore.v1.AllocateIdsResponse\"e\xda\x41\x0fproject_id,keys\x82\xd3\xe4\x93\x02*\"%/v1/projects/{project_id}:allocateIds:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xc3\x01\n\nReserveIds\x12&.google.datastore.v1.ReserveIdsRequest\x1a\'.google.datastore.v1.ReserveIdsResponse\"d\xda\x41\x0fproject_id,keys\x82\xd3\xe4\x93\x02)\"$/v1/projects/{project_id}:reserveIds:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x1av\xca\x41\x18\x64\x61tastore.googleapis.com\xd2\x41Xhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastoreB\xbf\x01\n\x17\x63om.google.datastore.v1B\x0e\x44\x61tastoreProtoP\x01Z;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb\xaa\x02\x19Google.Cloud.Datastore.V1\xca\x02\x19Google\\Cloud\\Datastore\\V1\xea\x02\x1cGoogle::Cloud::Datastore::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.datastore.v1.Key", "google/datastore/v1/entity.proto"], + ["google.datastore.v1.EntityResult", "google/datastore/v1/query.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.datastore.v1.ExplainOptions", "google/datastore/v1/query_profile.proto"], + ["google.datastore.v1.AggregationResultBatch", "google/datastore/v1/aggregation_result.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 Datastore + module V1 + LookupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.LookupRequest").msgclass + LookupResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.LookupResponse").msgclass + RunQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunQueryRequest").msgclass + RunQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunQueryResponse").msgclass + RunAggregationQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunAggregationQueryRequest").msgclass + RunAggregationQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunAggregationQueryResponse").msgclass + BeginTransactionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.BeginTransactionRequest").msgclass + BeginTransactionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.BeginTransactionResponse").msgclass + RollbackRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RollbackRequest").msgclass + RollbackResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RollbackResponse").msgclass + CommitRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.CommitRequest").msgclass + CommitRequest::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.CommitRequest.Mode").enummodule + CommitResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.CommitResponse").msgclass + AllocateIdsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AllocateIdsRequest").msgclass + AllocateIdsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AllocateIdsResponse").msgclass + ReserveIdsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ReserveIdsRequest").msgclass + ReserveIdsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ReserveIdsResponse").msgclass + Mutation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Mutation").msgclass + Mutation::ConflictResolutionStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Mutation.ConflictResolutionStrategy").enummodule + PropertyTransform = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyTransform").msgclass + PropertyTransform::ServerValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyTransform.ServerValue").enummodule + MutationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.MutationResult").msgclass + PropertyMask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyMask").msgclass + ReadOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ReadOptions").msgclass + ReadOptions::ReadConsistency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ReadOptions.ReadConsistency").enummodule + TransactionOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.TransactionOptions").msgclass + TransactionOptions::ReadWrite = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.TransactionOptions.ReadWrite").msgclass + TransactionOptions::ReadOnly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.TransactionOptions.ReadOnly").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_services_pb.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_services_pb.rb new file mode 100644 index 000000000000..f53f2cd7b06c --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_services_pb.rb @@ -0,0 +1,68 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/datastore/v1/datastore.proto for package 'Google.Cloud.Datastore.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/datastore/v1/datastore_pb' + +module Google + module Cloud + module Datastore + module V1 + module Datastore + # Each RPC normalizes the partition IDs of the keys in its input entities, + # and always returns entities with keys with normalized partition IDs. + # This applies to all keys and entities, including those in values, except keys + # with both an empty path and an empty or unset partition ID. Normalization of + # input keys sets the project ID (if not already set) to the project ID from + # the request. + # + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.datastore.v1.Datastore' + + # Looks up entities by key. + rpc :Lookup, ::Google::Cloud::Datastore::V1::LookupRequest, ::Google::Cloud::Datastore::V1::LookupResponse + # Queries for entities. + rpc :RunQuery, ::Google::Cloud::Datastore::V1::RunQueryRequest, ::Google::Cloud::Datastore::V1::RunQueryResponse + # Runs an aggregation query. + rpc :RunAggregationQuery, ::Google::Cloud::Datastore::V1::RunAggregationQueryRequest, ::Google::Cloud::Datastore::V1::RunAggregationQueryResponse + # Begins a new transaction. + rpc :BeginTransaction, ::Google::Cloud::Datastore::V1::BeginTransactionRequest, ::Google::Cloud::Datastore::V1::BeginTransactionResponse + # Commits a transaction, optionally creating, deleting or modifying some + # entities. + rpc :Commit, ::Google::Cloud::Datastore::V1::CommitRequest, ::Google::Cloud::Datastore::V1::CommitResponse + # Rolls back a transaction. + rpc :Rollback, ::Google::Cloud::Datastore::V1::RollbackRequest, ::Google::Cloud::Datastore::V1::RollbackResponse + # Allocates IDs for the given keys, which is useful for referencing an entity + # before it is inserted. + rpc :AllocateIds, ::Google::Cloud::Datastore::V1::AllocateIdsRequest, ::Google::Cloud::Datastore::V1::AllocateIdsResponse + # Prevents the supplied keys' IDs from being auto-allocated by Cloud + # Datastore. + rpc :ReserveIds, ::Google::Cloud::Datastore::V1::ReserveIdsRequest, ::Google::Cloud::Datastore::V1::ReserveIdsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/entity_pb.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/entity_pb.rb new file mode 100644 index 000000000000..a80ab75a63e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/entity_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/datastore/v1/entity.proto + +require 'google/protobuf' + +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/type/latlng_pb' + + +descriptor_data = "\n google/datastore/v1/entity.proto\x12\x13google.datastore.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x18google/type/latlng.proto\"L\n\x0bPartitionId\x12\x12\n\nproject_id\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x61tabase_id\x18\x03 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x04 \x01(\t\"\xb7\x01\n\x03Key\x12\x36\n\x0cpartition_id\x18\x01 \x01(\x0b\x32 .google.datastore.v1.PartitionId\x12\x32\n\x04path\x18\x02 \x03(\x0b\x32$.google.datastore.v1.Key.PathElement\x1a\x44\n\x0bPathElement\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0c\n\x02id\x18\x02 \x01(\x03H\x00\x12\x0e\n\x04name\x18\x03 \x01(\tH\x00\x42\t\n\x07id_type\"8\n\nArrayValue\x12*\n\x06values\x18\x01 \x03(\x0b\x32\x1a.google.datastore.v1.Value\"\xf1\x03\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-\n\tkey_value\x18\x05 \x01(\x0b\x32\x18.google.datastore.v1.KeyH\x00\x12\x16\n\x0cstring_value\x18\x11 \x01(\tH\x00\x12\x14\n\nblob_value\x18\x12 \x01(\x0cH\x00\x12.\n\x0fgeo_point_value\x18\x08 \x01(\x0b\x32\x13.google.type.LatLngH\x00\x12\x33\n\x0c\x65ntity_value\x18\x06 \x01(\x0b\x32\x1b.google.datastore.v1.EntityH\x00\x12\x36\n\x0b\x61rray_value\x18\t \x01(\x0b\x32\x1f.google.datastore.v1.ArrayValueH\x00\x12\x0f\n\x07meaning\x18\x0e \x01(\x05\x12\x1c\n\x14\x65xclude_from_indexes\x18\x13 \x01(\x08\x42\x0c\n\nvalue_type\"\xbf\x01\n\x06\x45ntity\x12%\n\x03key\x18\x01 \x01(\x0b\x32\x18.google.datastore.v1.Key\x12?\n\nproperties\x18\x03 \x03(\x0b\x32+.google.datastore.v1.Entity.PropertiesEntry\x1aM\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.datastore.v1.Value:\x02\x38\x01\x42\xbc\x01\n\x17\x63om.google.datastore.v1B\x0b\x45ntityProtoP\x01Z;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb\xaa\x02\x19Google.Cloud.Datastore.V1\xca\x02\x19Google\\Cloud\\Datastore\\V1\xea\x02\x1cGoogle::Cloud::Datastore::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 Datastore + module V1 + PartitionId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PartitionId").msgclass + Key = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Key").msgclass + Key::PathElement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Key.PathElement").msgclass + ArrayValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ArrayValue").msgclass + Value = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Value").msgclass + Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Entity").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_pb.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_pb.rb new file mode 100644 index 000000000000..3d0015501530 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_pb.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/datastore/v1/query.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/datastore/v1/entity_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' + + +descriptor_data = "\n\x1fgoogle/datastore/v1/query.proto\x12\x13google.datastore.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a google/datastore/v1/entity.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\x91\x02\n\x0c\x45ntityResult\x12+\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x1b.google.datastore.v1.Entity\x12\x0f\n\x07version\x18\x04 \x01(\x03\x12/\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0e\n\x06\x63ursor\x18\x03 \x01(\x0c\"Q\n\nResultType\x12\x1b\n\x17RESULT_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x46ULL\x10\x01\x12\x0e\n\nPROJECTION\x10\x02\x12\x0c\n\x08KEY_ONLY\x10\x03\"\xf2\x02\n\x05Query\x12\x33\n\nprojection\x18\x02 \x03(\x0b\x32\x1f.google.datastore.v1.Projection\x12\x31\n\x04kind\x18\x03 \x03(\x0b\x32#.google.datastore.v1.KindExpression\x12+\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x1b.google.datastore.v1.Filter\x12\x31\n\x05order\x18\x05 \x03(\x0b\x32\".google.datastore.v1.PropertyOrder\x12;\n\x0b\x64istinct_on\x18\x06 \x03(\x0b\x32&.google.datastore.v1.PropertyReference\x12\x14\n\x0cstart_cursor\x18\x07 \x01(\x0c\x12\x12\n\nend_cursor\x18\x08 \x01(\x0c\x12\x0e\n\x06offset\x18\n \x01(\x05\x12*\n\x05limit\x18\x0c \x01(\x0b\x32\x1b.google.protobuf.Int32Value\"\xe4\x04\n\x10\x41ggregationQuery\x12\x32\n\x0cnested_query\x18\x01 \x01(\x0b\x32\x1a.google.datastore.v1.QueryH\x00\x12L\n\x0c\x61ggregations\x18\x03 \x03(\x0b\x32\x31.google.datastore.v1.AggregationQuery.AggregationB\x03\xe0\x41\x01\x1a\xbf\x03\n\x0b\x41ggregation\x12H\n\x05\x63ount\x18\x01 \x01(\x0b\x32\x37.google.datastore.v1.AggregationQuery.Aggregation.CountH\x00\x12\x44\n\x03sum\x18\x02 \x01(\x0b\x32\x35.google.datastore.v1.AggregationQuery.Aggregation.SumH\x00\x12\x44\n\x03\x61vg\x18\x03 \x01(\x0b\x32\x35.google.datastore.v1.AggregationQuery.Aggregation.AvgH\x00\x12\x12\n\x05\x61lias\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\x38\n\x05\x43ount\x12/\n\x05up_to\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x1a?\n\x03Sum\x12\x38\n\x08property\x18\x01 \x01(\x0b\x32&.google.datastore.v1.PropertyReference\x1a?\n\x03\x41vg\x12\x38\n\x08property\x18\x01 \x01(\x0b\x32&.google.datastore.v1.PropertyReferenceB\n\n\x08operatorB\x0c\n\nquery_type\"\x1e\n\x0eKindExpression\x12\x0c\n\x04name\x18\x01 \x01(\t\"!\n\x11PropertyReference\x12\x0c\n\x04name\x18\x02 \x01(\t\"F\n\nProjection\x12\x38\n\x08property\x18\x01 \x01(\x0b\x32&.google.datastore.v1.PropertyReference\"\xd1\x01\n\rPropertyOrder\x12\x38\n\x08property\x18\x01 \x01(\x0b\x32&.google.datastore.v1.PropertyReference\x12?\n\tdirection\x18\x02 \x01(\x0e\x32,.google.datastore.v1.PropertyOrder.Direction\"E\n\tDirection\x12\x19\n\x15\x44IRECTION_UNSPECIFIED\x10\x00\x12\r\n\tASCENDING\x10\x01\x12\x0e\n\nDESCENDING\x10\x02\"\x99\x01\n\x06\x46ilter\x12@\n\x10\x63omposite_filter\x18\x01 \x01(\x0b\x32$.google.datastore.v1.CompositeFilterH\x00\x12>\n\x0fproperty_filter\x18\x02 \x01(\x0b\x32#.google.datastore.v1.PropertyFilterH\x00\x42\r\n\x0b\x66ilter_type\"\xb1\x01\n\x0f\x43ompositeFilter\x12\x39\n\x02op\x18\x01 \x01(\x0e\x32-.google.datastore.v1.CompositeFilter.Operator\x12,\n\x07\x66ilters\x18\x02 \x03(\x0b\x32\x1b.google.datastore.v1.Filter\"5\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41ND\x10\x01\x12\x06\n\x02OR\x10\x02\"\xea\x02\n\x0ePropertyFilter\x12\x38\n\x08property\x18\x01 \x01(\x0b\x32&.google.datastore.v1.PropertyReference\x12\x38\n\x02op\x18\x02 \x01(\x0e\x32,.google.datastore.v1.PropertyFilter.Operator\x12)\n\x05value\x18\x03 \x01(\x0b\x32\x1a.google.datastore.v1.Value\"\xb8\x01\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\r\n\tLESS_THAN\x10\x01\x12\x16\n\x12LESS_THAN_OR_EQUAL\x10\x02\x12\x10\n\x0cGREATER_THAN\x10\x03\x12\x19\n\x15GREATER_THAN_OR_EQUAL\x10\x04\x12\t\n\x05\x45QUAL\x10\x05\x12\x06\n\x02IN\x10\x06\x12\r\n\tNOT_EQUAL\x10\t\x12\x10\n\x0cHAS_ANCESTOR\x10\x0b\x12\n\n\x06NOT_IN\x10\r\"\xa5\x02\n\x08GqlQuery\x12\x14\n\x0cquery_string\x18\x01 \x01(\t\x12\x16\n\x0e\x61llow_literals\x18\x02 \x01(\x08\x12H\n\x0enamed_bindings\x18\x05 \x03(\x0b\x32\x30.google.datastore.v1.GqlQuery.NamedBindingsEntry\x12\x43\n\x13positional_bindings\x18\x04 \x03(\x0b\x32&.google.datastore.v1.GqlQueryParameter\x1a\\\n\x12NamedBindingsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32&.google.datastore.v1.GqlQueryParameter:\x02\x38\x01\"d\n\x11GqlQueryParameter\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.datastore.v1.ValueH\x00\x12\x10\n\x06\x63ursor\x18\x03 \x01(\x0cH\x00\x42\x10\n\x0eparameter_type\"\x8d\x04\n\x10QueryResultBatch\x12\x17\n\x0fskipped_results\x18\x06 \x01(\x05\x12\x16\n\x0eskipped_cursor\x18\x03 \x01(\x0c\x12H\n\x12\x65ntity_result_type\x18\x01 \x01(\x0e\x32,.google.datastore.v1.EntityResult.ResultType\x12\x39\n\x0e\x65ntity_results\x18\x02 \x03(\x0b\x32!.google.datastore.v1.EntityResult\x12\x12\n\nend_cursor\x18\x04 \x01(\x0c\x12K\n\x0cmore_results\x18\x05 \x01(\x0e\x32\x35.google.datastore.v1.QueryResultBatch.MoreResultsType\x12\x18\n\x10snapshot_version\x18\x07 \x01(\x03\x12-\n\tread_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x98\x01\n\x0fMoreResultsType\x12!\n\x1dMORE_RESULTS_TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cNOT_FINISHED\x10\x01\x12\x1c\n\x18MORE_RESULTS_AFTER_LIMIT\x10\x02\x12\x1d\n\x19MORE_RESULTS_AFTER_CURSOR\x10\x04\x12\x13\n\x0fNO_MORE_RESULTS\x10\x03\x42\xbb\x01\n\x17\x63om.google.datastore.v1B\nQueryProtoP\x01Z;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb\xaa\x02\x19Google.Cloud.Datastore.V1\xca\x02\x19Google\\Cloud\\Datastore\\V1\xea\x02\x1cGoogle::Cloud::Datastore::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.datastore.v1.Entity", "google/datastore/v1/entity.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Int32Value", "google/protobuf/wrappers.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 Datastore + module V1 + EntityResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.EntityResult").msgclass + EntityResult::ResultType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.EntityResult.ResultType").enummodule + Query = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Query").msgclass + AggregationQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationQuery").msgclass + AggregationQuery::Aggregation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationQuery.Aggregation").msgclass + AggregationQuery::Aggregation::Count = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationQuery.Aggregation.Count").msgclass + AggregationQuery::Aggregation::Sum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationQuery.Aggregation.Sum").msgclass + AggregationQuery::Aggregation::Avg = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationQuery.Aggregation.Avg").msgclass + KindExpression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.KindExpression").msgclass + PropertyReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyReference").msgclass + Projection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Projection").msgclass + PropertyOrder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyOrder").msgclass + PropertyOrder::Direction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyOrder.Direction").enummodule + Filter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Filter").msgclass + CompositeFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.CompositeFilter").msgclass + CompositeFilter::Operator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.CompositeFilter.Operator").enummodule + PropertyFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyFilter").msgclass + PropertyFilter::Operator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyFilter.Operator").enummodule + GqlQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.GqlQuery").msgclass + GqlQueryParameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.GqlQueryParameter").msgclass + QueryResultBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.QueryResultBatch").msgclass + QueryResultBatch::MoreResultsType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.QueryResultBatch.MoreResultsType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_profile_pb.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_profile_pb.rb new file mode 100644 index 000000000000..573a5bd2c0b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_profile_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/datastore/v1/query_profile.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n\'google/datastore/v1/query_profile.proto\x12\x13google.datastore.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\"&\n\x0e\x45xplainOptions\x12\x14\n\x07\x61nalyze\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"\x86\x01\n\x0e\x45xplainMetrics\x12\x36\n\x0cplan_summary\x18\x01 \x01(\x0b\x32 .google.datastore.v1.PlanSummary\x12<\n\x0f\x65xecution_stats\x18\x02 \x01(\x0b\x32#.google.datastore.v1.ExecutionStats\"<\n\x0bPlanSummary\x12-\n\x0cindexes_used\x18\x01 \x03(\x0b\x32\x17.google.protobuf.Struct\"\xa8\x01\n\x0e\x45xecutionStats\x12\x18\n\x10results_returned\x18\x01 \x01(\x03\x12\x35\n\x12\x65xecution_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x17\n\x0fread_operations\x18\x04 \x01(\x03\x12,\n\x0b\x64\x65\x62ug_stats\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructB\xc2\x01\n\x17\x63om.google.datastore.v1B\x11QueryProfileProtoP\x01Z;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb\xaa\x02\x19Google.Cloud.Datastore.V1\xca\x02\x19Google\\Cloud\\Datastore\\V1\xea\x02\x1cGoogle::Cloud::Datastore::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Datastore + module V1 + ExplainOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ExplainOptions").msgclass + ExplainMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ExplainMetrics").msgclass + PlanSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PlanSummary").msgclass + ExecutionStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ExecutionStats").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/README.md new file mode 100644 index 000000000000..10c788a336b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Firestore in Datastore mode V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..2223d8935069 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/client.rb @@ -0,0 +1,420 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!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. + 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. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # 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 + + # 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-datastore-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..b03587481349 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..38b4b61e6061 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..935946d52792 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. 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-datastore-v1/proto_docs/google/api/routing.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/routing.rb new file mode 100644 index 000000000000..53c8874ea19d --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/routing.rb @@ -0,0 +1,459 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # 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`. + # In the examples below I am skipping the percent-encoding for readablity. + # + # 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-datastore-v1/proto_docs/google/datastore/v1/aggregation_result.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/aggregation_result.rb new file mode 100644 index 000000000000..7224fe9fd4a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/aggregation_result.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Datastore + module V1 + # The result of a single bucket from a Datastore aggregation query. + # + # The keys of `aggregate_properties` are the same for all results in an + # aggregation query, unlike entity queries which can have different fields + # present for each result. + # @!attribute [rw] aggregate_properties + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Datastore::V1::Value}] + # The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + # + # The key is the + # {::Google::Cloud::Datastore::V1::AggregationQuery::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::Datastore::V1::Value] + class AggregatePropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A batch of aggregation results produced by an aggregation query. + # @!attribute [rw] aggregation_results + # @return [::Array<::Google::Cloud::Datastore::V1::AggregationResult>] + # The aggregation results for this batch. + # @!attribute [rw] more_results + # @return [::Google::Cloud::Datastore::V1::QueryResultBatch::MoreResultsType] + # The state of the query after the current batch. + # Only COUNT(*) aggregations are supported in the initial launch. Therefore, + # expected result type is limited to `NO_MORE_RESULTS`. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Read timestamp this batch was returned from. + # + # In a single transaction, subsequent query result batches for the same query + # can have a greater timestamp. Each batch's read timestamp + # is valid for all preceding batches. + class AggregationResultBatch + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/datastore.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/datastore.rb new file mode 100644 index 000000000000..c9d762c8f17c --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/datastore.rb @@ -0,0 +1,709 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Datastore + module V1 + # The request for {::Google::Cloud::Datastore::V1::Datastore::Client#lookup Datastore.Lookup}. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the project against which to make the request. + # @!attribute [rw] database_id + # @return [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @!attribute [rw] read_options + # @return [::Google::Cloud::Datastore::V1::ReadOptions] + # The options for this lookup request. + # @!attribute [rw] keys + # @return [::Array<::Google::Cloud::Datastore::V1::Key>] + # Required. Keys of entities to look up. + # @!attribute [rw] property_mask + # @return [::Google::Cloud::Datastore::V1::PropertyMask] + # The properties to return. Defaults to returning all properties. + # + # If this field is set and an entity has a property not referenced in the + # mask, it will be absent from [LookupResponse.found.entity.properties][]. + # + # The entity's key is always returned. + class LookupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for {::Google::Cloud::Datastore::V1::Datastore::Client#lookup Datastore.Lookup}. + # @!attribute [rw] found + # @return [::Array<::Google::Cloud::Datastore::V1::EntityResult>] + # Entities found as `ResultType.FULL` entities. The order of results in this + # field is undefined and has no relation to the order of the keys in the + # input. + # @!attribute [rw] missing + # @return [::Array<::Google::Cloud::Datastore::V1::EntityResult>] + # Entities not found as `ResultType.KEY_ONLY` entities. The order of results + # in this field is undefined and has no relation to the order of the keys + # in the input. + # @!attribute [rw] deferred + # @return [::Array<::Google::Cloud::Datastore::V1::Key>] + # A list of keys that were not looked up due to resource constraints. The + # order of results in this field is undefined and has no relation to the + # order of the keys in the input. + # @!attribute [rw] transaction + # @return [::String] + # The identifier of the transaction that was started as part of this Lookup + # request. + # + # Set only when + # {::Google::Cloud::Datastore::V1::ReadOptions#new_transaction ReadOptions.new_transaction} + # was set in + # {::Google::Cloud::Datastore::V1::LookupRequest#read_options LookupRequest.read_options}. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # The time at which these entities were read or found missing. + class LookupResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Datastore::V1::Datastore::Client#run_query Datastore.RunQuery}. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the project against which to make the request. + # @!attribute [rw] database_id + # @return [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @!attribute [rw] partition_id + # @return [::Google::Cloud::Datastore::V1::PartitionId] + # Entities are partitioned into subsets, identified by a partition ID. + # Queries are scoped to a single partition. + # This partition ID is normalized with the standard default context + # partition ID. + # @!attribute [rw] read_options + # @return [::Google::Cloud::Datastore::V1::ReadOptions] + # The options for this query. + # @!attribute [rw] query + # @return [::Google::Cloud::Datastore::V1::Query] + # The query to run. + # @!attribute [rw] gql_query + # @return [::Google::Cloud::Datastore::V1::GqlQuery] + # The GQL query to run. This query must be a non-aggregation query. + # @!attribute [rw] property_mask + # @return [::Google::Cloud::Datastore::V1::PropertyMask] + # The properties to return. + # This field must not be set for a projection query. + # + # See + # {::Google::Cloud::Datastore::V1::LookupRequest#property_mask LookupRequest.property_mask}. + # @!attribute [rw] explain_options + # @return [::Google::Cloud::Datastore::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::Datastore::V1::Datastore::Client#run_query Datastore.RunQuery}. + # @!attribute [rw] batch + # @return [::Google::Cloud::Datastore::V1::QueryResultBatch] + # A batch of query results (always present). + # @!attribute [rw] query + # @return [::Google::Cloud::Datastore::V1::Query] + # The parsed form of the `GqlQuery` from the request, if it was set. + # @!attribute [rw] transaction + # @return [::String] + # The identifier of the transaction that was started as part of this + # RunQuery request. + # + # Set only when + # {::Google::Cloud::Datastore::V1::ReadOptions#new_transaction ReadOptions.new_transaction} + # was set in + # {::Google::Cloud::Datastore::V1::RunQueryRequest#read_options RunQueryRequest.read_options}. + # @!attribute [rw] explain_metrics + # @return [::Google::Cloud::Datastore::V1::ExplainMetrics] + # Query explain metrics. This is only present when the + # {::Google::Cloud::Datastore::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::Datastore::V1::Datastore::Client#run_aggregation_query Datastore.RunAggregationQuery}. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the project against which to make the request. + # @!attribute [rw] database_id + # @return [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @!attribute [rw] partition_id + # @return [::Google::Cloud::Datastore::V1::PartitionId] + # Entities are partitioned into subsets, identified by a partition ID. + # Queries are scoped to a single partition. + # This partition ID is normalized with the standard default context + # partition ID. + # @!attribute [rw] read_options + # @return [::Google::Cloud::Datastore::V1::ReadOptions] + # The options for this query. + # @!attribute [rw] aggregation_query + # @return [::Google::Cloud::Datastore::V1::AggregationQuery] + # The query to run. + # @!attribute [rw] gql_query + # @return [::Google::Cloud::Datastore::V1::GqlQuery] + # The GQL query to run. This query must be an aggregation query. + # @!attribute [rw] explain_options + # @return [::Google::Cloud::Datastore::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::Datastore::V1::Datastore::Client#run_aggregation_query Datastore.RunAggregationQuery}. + # @!attribute [rw] batch + # @return [::Google::Cloud::Datastore::V1::AggregationResultBatch] + # A batch of aggregation results. Always present. + # @!attribute [rw] query + # @return [::Google::Cloud::Datastore::V1::AggregationQuery] + # The parsed form of the `GqlQuery` from the request, if it was set. + # @!attribute [rw] transaction + # @return [::String] + # The identifier of the transaction that was started as part of this + # RunAggregationQuery request. + # + # Set only when + # {::Google::Cloud::Datastore::V1::ReadOptions#new_transaction ReadOptions.new_transaction} + # was set in + # {::Google::Cloud::Datastore::V1::RunAggregationQueryRequest#read_options RunAggregationQueryRequest.read_options}. + # @!attribute [rw] explain_metrics + # @return [::Google::Cloud::Datastore::V1::ExplainMetrics] + # Query explain metrics. This is only present when the + # {::Google::Cloud::Datastore::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::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the project against which to make the request. + # @!attribute [rw] database_id + # @return [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @!attribute [rw] transaction_options + # @return [::Google::Cloud::Datastore::V1::TransactionOptions] + # Options for a new transaction. + class BeginTransactionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}. + # @!attribute [rw] transaction + # @return [::String] + # The transaction identifier (always present). + class BeginTransactionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Datastore::V1::Datastore::Client#rollback Datastore.Rollback}. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the project against which to make the request. + # @!attribute [rw] database_id + # @return [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @!attribute [rw] transaction + # @return [::String] + # Required. The transaction identifier, returned by a call to + # {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}. + class RollbackRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Datastore::V1::Datastore::Client#rollback Datastore.Rollback}. (an empty + # message). + class RollbackResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for {::Google::Cloud::Datastore::V1::Datastore::Client#commit Datastore.Commit}. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the project against which to make the request. + # @!attribute [rw] database_id + # @return [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @!attribute [rw] mode + # @return [::Google::Cloud::Datastore::V1::CommitRequest::Mode] + # The type of commit to perform. Defaults to `TRANSACTIONAL`. + # @!attribute [rw] transaction + # @return [::String] + # The identifier of the transaction associated with the commit. A + # transaction identifier is returned by a call to + # {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}. + # @!attribute [rw] single_use_transaction + # @return [::Google::Cloud::Datastore::V1::TransactionOptions] + # Options for beginning a new transaction for this request. + # The transaction is committed when the request completes. If specified, + # {::Google::Cloud::Datastore::V1::TransactionOptions TransactionOptions.mode} must be + # {::Google::Cloud::Datastore::V1::TransactionOptions::ReadWrite TransactionOptions.ReadWrite}. + # @!attribute [rw] mutations + # @return [::Array<::Google::Cloud::Datastore::V1::Mutation>] + # The mutations to perform. + # + # When mode is `TRANSACTIONAL`, mutations affecting a single entity are + # applied in order. The following sequences of mutations affecting a single + # entity are not permitted in a single `Commit` request: + # + # - `insert` followed by `insert` + # - `update` followed by `insert` + # - `upsert` followed by `insert` + # - `delete` followed by `update` + # + # When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + # entity. + class CommitRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The modes available for commits. + module Mode + # Unspecified. This value must not be used. + MODE_UNSPECIFIED = 0 + + # Transactional: The mutations are either all applied, or none are applied. + # Learn about transactions + # [here](https://cloud.google.com/datastore/docs/concepts/transactions). + TRANSACTIONAL = 1 + + # Non-transactional: The mutations may not apply as all or none. + NON_TRANSACTIONAL = 2 + end + end + + # The response for {::Google::Cloud::Datastore::V1::Datastore::Client#commit Datastore.Commit}. + # @!attribute [rw] mutation_results + # @return [::Array<::Google::Cloud::Datastore::V1::MutationResult>] + # The result of performing the mutations. + # The i-th mutation result corresponds to the i-th mutation in the request. + # @!attribute [rw] index_updates + # @return [::Integer] + # The number of index entries updated during the commit, or zero if none were + # updated. + # @!attribute [rw] commit_time + # @return [::Google::Protobuf::Timestamp] + # The transaction commit timestamp. Not set for non-transactional commits. + class CommitResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Datastore::V1::Datastore::Client#allocate_ids Datastore.AllocateIds}. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the project against which to make the request. + # @!attribute [rw] database_id + # @return [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @!attribute [rw] keys + # @return [::Array<::Google::Cloud::Datastore::V1::Key>] + # Required. A list of keys with incomplete key paths for which to allocate + # IDs. No key may be reserved/read-only. + class AllocateIdsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Datastore::V1::Datastore::Client#allocate_ids Datastore.AllocateIds}. + # @!attribute [rw] keys + # @return [::Array<::Google::Cloud::Datastore::V1::Key>] + # The keys specified in the request (in the same order), each with + # its key path completed with a newly allocated ID. + class AllocateIdsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Datastore::V1::Datastore::Client#reserve_ids Datastore.ReserveIds}. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the project against which to make the request. + # @!attribute [rw] database_id + # @return [::String] + # The ID of the database against which to make the request. + # + # '(default)' is not allowed; please use empty string '' to refer the default + # database. + # @!attribute [rw] keys + # @return [::Array<::Google::Cloud::Datastore::V1::Key>] + # Required. A list of keys with complete key paths whose numeric IDs should + # not be auto-allocated. + class ReserveIdsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Datastore::V1::Datastore::Client#reserve_ids Datastore.ReserveIds}. + class ReserveIdsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A mutation to apply to an entity. + # @!attribute [rw] insert + # @return [::Google::Cloud::Datastore::V1::Entity] + # The entity to insert. The entity must not already exist. + # The entity key's final path element may be incomplete. + # @!attribute [rw] update + # @return [::Google::Cloud::Datastore::V1::Entity] + # The entity to update. The entity must already exist. + # Must have a complete key path. + # @!attribute [rw] upsert + # @return [::Google::Cloud::Datastore::V1::Entity] + # The entity to upsert. The entity may or may not already exist. + # The entity key's final path element may be incomplete. + # @!attribute [rw] delete + # @return [::Google::Cloud::Datastore::V1::Key] + # The key of the entity to delete. The entity may or may not already exist. + # Must have a complete key path and must not be reserved/read-only. + # @!attribute [rw] base_version + # @return [::Integer] + # The version of the entity that this mutation is being applied + # to. If this does not match the current version on the server, the + # mutation conflicts. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The update time of the entity that this mutation is being applied + # to. If this does not match the current update time on the server, the + # mutation conflicts. + # @!attribute [rw] conflict_resolution_strategy + # @return [::Google::Cloud::Datastore::V1::Mutation::ConflictResolutionStrategy] + # The strategy to use when a conflict is detected. Defaults to + # `SERVER_VALUE`. + # If this is set, then `conflict_detection_strategy` must also be set. + # @!attribute [rw] property_mask + # @return [::Google::Cloud::Datastore::V1::PropertyMask] + # The properties to write in this mutation. + # None of the properties in the mask may have a reserved name, except for + # `__key__`. + # This field is ignored for `delete`. + # + # If the entity already exists, only properties referenced in the mask are + # updated, others are left untouched. + # Properties referenced in the mask but not in the entity are deleted. + # @!attribute [rw] property_transforms + # @return [::Array<::Google::Cloud::Datastore::V1::PropertyTransform>] + # Optional. The transforms to perform on the entity. + # + # This field can be set only when the operation is `insert`, `update`, + # or `upsert`. If present, the transforms are be applied to the entity + # regardless of the property mask, in order, after the operation. + class Mutation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The possible ways to resolve a conflict detected in a mutation. + module ConflictResolutionStrategy + # Unspecified. Defaults to `SERVER_VALUE`. + STRATEGY_UNSPECIFIED = 0 + + # The server entity is kept. + SERVER_VALUE = 1 + + # The whole commit request fails. + FAIL = 3 + end + end + + # A transformation of an entity property. + # @!attribute [rw] property + # @return [::String] + # Optional. The name of the property. + # + # Property paths (a list of property names separated by dots (`.`)) may be + # used to refer to properties inside entity values. For example `foo.bar` + # means the property `bar` inside the entity property `foo`. + # + # If a property name contains a dot `.` or a backlslash `\`, then that name + # must be escaped. + # @!attribute [rw] set_to_server_value + # @return [::Google::Cloud::Datastore::V1::PropertyTransform::ServerValue] + # Sets the property to the given server value. + # @!attribute [rw] increment + # @return [::Google::Cloud::Datastore::V1::Value] + # Adds the given value to the property's current value. + # + # This must be an integer or a double value. + # If the property is not an integer or double, or if the property does not + # yet exist, the transformation will set the property to the given value. + # If either of the given value or the current property value are doubles, + # both values will be interpreted as doubles. Double arithmetic and + # representation of double values follows IEEE 754 semantics. + # If there is positive/negative integer overflow, the property is resolved + # to the largest magnitude positive/negative integer. + # @!attribute [rw] maximum + # @return [::Google::Cloud::Datastore::V1::Value] + # Sets the property to the maximum of its current value and the given + # value. + # + # This must be an integer or a double value. + # If the property is not an integer or double, or if the property does not + # yet exist, the transformation will set the property to the given value. + # If a maximum operation is applied where the property and the input value + # are of mixed types (that is - one is an integer and one is a double) + # the property takes on the type of the larger operand. If the operands are + # equivalent (e.g. 3 and 3.0), the property 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. + # @!attribute [rw] minimum + # @return [::Google::Cloud::Datastore::V1::Value] + # Sets the property to the minimum of its current value and the given + # value. + # + # This must be an integer or a double value. + # If the property is not an integer or double, or if the property does not + # yet exist, the transformation will set the property to the input value. + # If a minimum operation is applied where the property and the input value + # are of mixed types (that is - one is an integer and one is a double) + # the property takes on the type of the smaller operand. If the operands + # are equivalent (e.g. 3 and 3.0), the property 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. + # @!attribute [rw] append_missing_elements + # @return [::Google::Cloud::Datastore::V1::ArrayValue] + # Appends the given elements in order if they are not already present in + # the current property value. + # If the property is not an array, or if the property 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 the null value is equal to the null value. + # If the input contains multiple equivalent values, only the first will + # be considered. + # + # The corresponding transform result will be the null value. + # @!attribute [rw] remove_all_from_array + # @return [::Google::Cloud::Datastore::V1::ArrayValue] + # Removes all of the given elements from the array in the property. + # If the property is not an array, or if the property does not yet exist, + # it is set to the empty array. + # + # Equivalent numbers of 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 the null value is equal to the null value. + # This will remove all equivalent values if there are duplicates. + # + # The corresponding transform result will be the null value. + class PropertyTransform + 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 properties (same or different entities) + # in a transaction, all the properties will get the same server timestamp. + REQUEST_TIME = 1 + end + end + + # The result of applying a mutation. + # @!attribute [rw] key + # @return [::Google::Cloud::Datastore::V1::Key] + # The automatically allocated key. + # Set only when the mutation allocated a key. + # @!attribute [rw] version + # @return [::Integer] + # The version of the entity on the server after processing the mutation. If + # the mutation doesn't change anything on the server, then the version will + # be the version of the current entity or, if no entity is present, a version + # that is strictly greater than the version of any previous entity and less + # than the version of any possible future entity. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The create time of the entity. This field will not be set after a 'delete'. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The update time of the entity on the server after processing the mutation. + # If the mutation doesn't change anything on the server, then the timestamp + # will be the update timestamp of the current entity. This field will not be + # set after a 'delete'. + # @!attribute [rw] conflict_detected + # @return [::Boolean] + # Whether a conflict was detected for this mutation. Always false when a + # conflict detection strategy field is not set in the mutation. + # @!attribute [rw] transform_results + # @return [::Array<::Google::Cloud::Datastore::V1::Value>] + # The results of applying each + # {::Google::Cloud::Datastore::V1::PropertyTransform PropertyTransform}, in the same + # order of the request. + class MutationResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The set of arbitrarily nested property paths used to restrict an operation to + # only a subset of properties in an entity. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The paths to the properties covered by this mask. + # + # A path is a list of property names separated by dots (`.`), for example + # `foo.bar` means the property `bar` inside the entity property `foo` inside + # the entity associated with this path. + # + # If a property name contains a dot `.` or a backslash `\`, then that + # name must be escaped. + # + # A path must not be empty, and may not reference a value inside an + # {::Google::Cloud::Datastore::V1::Value#array_value array value}. + class PropertyMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The options shared by read requests. + # @!attribute [rw] read_consistency + # @return [::Google::Cloud::Datastore::V1::ReadOptions::ReadConsistency] + # The non-transactional read consistency to use. + # @!attribute [rw] transaction + # @return [::String] + # The identifier of the transaction in which to read. A + # transaction identifier is returned by a call to + # {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}. + # @!attribute [rw] new_transaction + # @return [::Google::Cloud::Datastore::V1::TransactionOptions] + # Options for beginning a new transaction for this request. + # + # The new transaction identifier will be returned in the corresponding + # response as either + # {::Google::Cloud::Datastore::V1::LookupResponse#transaction LookupResponse.transaction} + # or + # {::Google::Cloud::Datastore::V1::RunQueryResponse#transaction RunQueryResponse.transaction}. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Reads entities as they were at the given time. This value is only + # supported for Cloud Firestore in Datastore mode. + # + # 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 ReadOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The possible values for read consistencies. + module ReadConsistency + # Unspecified. This value must not be used. + READ_CONSISTENCY_UNSPECIFIED = 0 + + # Strong consistency. + STRONG = 1 + + # Eventual consistency. + EVENTUAL = 2 + end + end + + # Options for beginning a new transaction. + # + # Transactions can be created explicitly with calls to + # {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction} + # or implicitly by setting + # {::Google::Cloud::Datastore::V1::ReadOptions#new_transaction ReadOptions.new_transaction} + # in read requests. + # @!attribute [rw] read_write + # @return [::Google::Cloud::Datastore::V1::TransactionOptions::ReadWrite] + # The transaction should allow both reads and writes. + # @!attribute [rw] read_only + # @return [::Google::Cloud::Datastore::V1::TransactionOptions::ReadOnly] + # The transaction should only allow reads. + class TransactionOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Options specific to read / write transactions. + # @!attribute [rw] previous_transaction + # @return [::String] + # The transaction identifier of the transaction being retried. + class ReadWrite + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options specific to read-only transactions. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Reads entities 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-datastore-v1/proto_docs/google/datastore/v1/entity.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/entity.rb new file mode 100644 index 000000000000..aecd57bcf4d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/entity.rb @@ -0,0 +1,235 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Datastore + module V1 + # A partition ID identifies a grouping of entities. The grouping is always + # by project and namespace, however the namespace ID may be empty. + # + # A partition ID contains several dimensions: + # project ID and namespace ID. + # + # Partition dimensions: + # + # - May be `""`. + # - Must be valid UTF-8 bytes. + # - Must have values that match regex `[A-Za-z\d\.\-_]{1,100}` + # If the value of any dimension matches regex `__.*__`, the partition is + # reserved/read-only. + # A reserved/read-only partition ID is forbidden in certain documented + # contexts. + # + # Foreign partition IDs (in which the project ID does + # not match the context project ID ) are discouraged. + # Reads and writes of foreign partition IDs may fail if the project is not in + # an active state. + # @!attribute [rw] project_id + # @return [::String] + # The ID of the project to which the entities belong. + # @!attribute [rw] database_id + # @return [::String] + # If not empty, the ID of the database to which the entities + # belong. + # @!attribute [rw] namespace_id + # @return [::String] + # If not empty, the ID of the namespace to which the entities belong. + class PartitionId + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A unique identifier for an entity. + # If a key's partition ID or any of its path kinds or names are + # reserved/read-only, the key is reserved/read-only. + # A reserved/read-only key is forbidden in certain documented contexts. + # @!attribute [rw] partition_id + # @return [::Google::Cloud::Datastore::V1::PartitionId] + # Entities are partitioned into subsets, currently identified by a project + # ID and namespace ID. + # Queries are scoped to a single partition. + # @!attribute [rw] path + # @return [::Array<::Google::Cloud::Datastore::V1::Key::PathElement>] + # The entity path. + # An entity path consists of one or more elements composed of a kind and a + # string or numerical identifier, which identify entities. The first + # element identifies a _root entity_, the second element identifies + # a _child_ of the root entity, the third element identifies a child of the + # second entity, and so forth. The entities identified by all prefixes of + # the path are called the element's _ancestors_. + # + # An entity path is always fully complete: *all* of the entity's ancestors + # are required to be in the path along with the entity identifier itself. + # The only exception is that in some documented cases, the identifier in the + # last path element (for the entity) itself may be omitted. For example, + # the last path element of the key of `Mutation.insert` may have no + # identifier. + # + # A path can never be empty, and a path can have at most 100 elements. + class Key + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A (kind, ID/name) pair used to construct a key path. + # + # If either name or ID is set, the element is complete. + # If neither is set, the element is incomplete. + # @!attribute [rw] kind + # @return [::String] + # The kind of the entity. + # + # A kind matching regex `__.*__` is reserved/read-only. + # A kind must not contain more than 1500 bytes when UTF-8 encoded. + # Cannot be `""`. + # + # Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + # encoded as `__bytes__` where `` is the base-64 encoding of the + # bytes. + # @!attribute [rw] id + # @return [::Integer] + # The auto-allocated ID of the entity. + # + # Never equal to zero. Values less than zero are discouraged and may not + # be supported in the future. + # @!attribute [rw] name + # @return [::String] + # The name of the entity. + # + # A name matching regex `__.*__` is reserved/read-only. + # A name must not be more than 1500 bytes when UTF-8 encoded. + # Cannot be `""`. + # + # Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + # encoded as `__bytes__` where `` is the base-64 encoding of the + # bytes. + class PathElement + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # An array value. + # @!attribute [rw] values + # @return [::Array<::Google::Cloud::Datastore::V1::Value>] + # Values in the array. + # The order of values in an array is preserved as long as all values have + # identical settings for 'exclude_from_indexes'. + class ArrayValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message that can hold any of the supported value types and associated + # metadata. + # @!attribute [rw] null_value + # @return [::Google::Protobuf::NullValue] + # A null value. + # @!attribute [rw] boolean_value + # @return [::Boolean] + # A boolean value. + # @!attribute [rw] integer_value + # @return [::Integer] + # An integer value. + # @!attribute [rw] double_value + # @return [::Float] + # A double value. + # @!attribute [rw] timestamp_value + # @return [::Google::Protobuf::Timestamp] + # A timestamp value. + # When stored in the Datastore, precise only to microseconds; + # any additional precision is rounded down. + # @!attribute [rw] key_value + # @return [::Google::Cloud::Datastore::V1::Key] + # A key value. + # @!attribute [rw] string_value + # @return [::String] + # A UTF-8 encoded string value. + # When `exclude_from_indexes` is false (it is indexed) , may have at most + # 1500 bytes. Otherwise, may be set to at most 1,000,000 bytes. + # @!attribute [rw] blob_value + # @return [::String] + # A blob value. + # May have at most 1,000,000 bytes. + # When `exclude_from_indexes` is false, may have at most 1500 bytes. + # In JSON requests, must be base64-encoded. + # @!attribute [rw] geo_point_value + # @return [::Google::Type::LatLng] + # A geo point value representing a point on the surface of Earth. + # @!attribute [rw] entity_value + # @return [::Google::Cloud::Datastore::V1::Entity] + # An entity value. + # + # - May have no key. + # - May have a key with an incomplete key path. + # - May have a reserved/read-only key. + # @!attribute [rw] array_value + # @return [::Google::Cloud::Datastore::V1::ArrayValue] + # An array value. + # Cannot contain another array value. + # A `Value` instance that sets field `array_value` must not set fields + # `meaning` or `exclude_from_indexes`. + # @!attribute [rw] meaning + # @return [::Integer] + # The `meaning` field should only be populated for backwards compatibility. + # @!attribute [rw] exclude_from_indexes + # @return [::Boolean] + # If the value should be excluded from all indexes including those defined + # explicitly. + class Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Datastore data object. + # + # Must not exceed 1 MiB - 4 bytes. + # @!attribute [rw] key + # @return [::Google::Cloud::Datastore::V1::Key] + # The entity's key. + # + # An entity must have a key, unless otherwise documented (for example, + # an entity in `Value.entity_value` may have no key). + # An entity's kind is its key path's last element's kind, + # or null if it has no key. + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Datastore::V1::Value}] + # The entity's properties. + # The map's keys are property names. + # A property name matching regex `__.*__` is reserved. + # A reserved property name is forbidden in certain documented contexts. + # The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot + # be empty. + class Entity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Datastore::V1::Value] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query.rb new file mode 100644 index 000000000000..6b67c1815763 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query.rb @@ -0,0 +1,584 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Datastore + module V1 + # The result of fetching an entity from Datastore. + # @!attribute [rw] entity + # @return [::Google::Cloud::Datastore::V1::Entity] + # The resulting entity. + # @!attribute [rw] version + # @return [::Integer] + # The version of the entity, a strictly positive number that monotonically + # increases with changes to the entity. + # + # This field is set for + # {::Google::Cloud::Datastore::V1::EntityResult::ResultType::FULL `FULL`} entity results. + # + # For {::Google::Cloud::Datastore::V1::LookupResponse#missing missing} entities in + # `LookupResponse`, this is the version of the snapshot that was used to look + # up the entity, and it is always set except for eventually consistent reads. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the entity was created. + # This field is set for + # {::Google::Cloud::Datastore::V1::EntityResult::ResultType::FULL `FULL`} entity results. + # If this entity is missing, this field will not be set. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the entity was last changed. + # This field is set for + # {::Google::Cloud::Datastore::V1::EntityResult::ResultType::FULL `FULL`} entity results. + # If this entity is missing, this field will not be set. + # @!attribute [rw] cursor + # @return [::String] + # A cursor that points to the position after the result entity. + # Set only when the `EntityResult` is part of a `QueryResultBatch` message. + class EntityResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies what data the 'entity' field contains. + # A `ResultType` is either implied (for example, in `LookupResponse.missing` + # from `datastore.proto`, it is always `KEY_ONLY`) or specified by context + # (for example, in message `QueryResultBatch`, field `entity_result_type` + # specifies a `ResultType` for all the values in field `entity_results`). + module ResultType + # Unspecified. This value is never used. + RESULT_TYPE_UNSPECIFIED = 0 + + # The key and properties. + FULL = 1 + + # A projected subset of properties. The entity may have no key. + PROJECTION = 2 + + # Only the key. + KEY_ONLY = 3 + end + end + + # A query for entities. + # @!attribute [rw] projection + # @return [::Array<::Google::Cloud::Datastore::V1::Projection>] + # The projection to return. Defaults to returning all properties. + # @!attribute [rw] kind + # @return [::Array<::Google::Cloud::Datastore::V1::KindExpression>] + # The kinds to query (if empty, returns entities of all kinds). + # Currently at most 1 kind may be specified. + # @!attribute [rw] filter + # @return [::Google::Cloud::Datastore::V1::Filter] + # The filter to apply. + # @!attribute [rw] order + # @return [::Array<::Google::Cloud::Datastore::V1::PropertyOrder>] + # The order to apply to the query results (if empty, order is unspecified). + # @!attribute [rw] distinct_on + # @return [::Array<::Google::Cloud::Datastore::V1::PropertyReference>] + # The properties to make distinct. The query results will contain the first + # result for each distinct combination of values for the given properties + # (if empty, all results are returned). + # + # Requires: + # + # * If `order` is specified, the set of distinct on properties must appear + # before the non-distinct on properties in `order`. + # @!attribute [rw] start_cursor + # @return [::String] + # A starting point for the query results. Query cursors are + # returned in query result batches and + # [can only be used to continue the same + # query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + # @!attribute [rw] end_cursor + # @return [::String] + # An ending point for the query results. Query cursors are + # returned in query result batches and + # [can only be used to limit the same + # query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + # @!attribute [rw] offset + # @return [::Integer] + # The number of results to skip. Applies before limit, but after all other + # constraints. Optional. Must be >= 0 if specified. + # @!attribute [rw] limit + # @return [::Google::Protobuf::Int32Value] + # The maximum number of results to return. Applies after all other + # constraints. Optional. + # Unspecified is interpreted as no limit. + # Must be >= 0 if specified. + class Query + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Datastore query for running an aggregation over a + # {::Google::Cloud::Datastore::V1::Query Query}. + # @!attribute [rw] nested_query + # @return [::Google::Cloud::Datastore::V1::Query] + # Nested query for aggregation + # @!attribute [rw] aggregations + # @return [::Array<::Google::Cloud::Datastore::V1::AggregationQuery::Aggregation>] + # Optional. Series of aggregations to apply over the results of the + # `nested_query`. + # + # Requires: + # + # * A minimum of one and maximum of five aggregations per query. + class AggregationQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines an aggregation that produces a single result. + # @!attribute [rw] count + # @return [::Google::Cloud::Datastore::V1::AggregationQuery::Aggregation::Count] + # Count aggregator. + # @!attribute [rw] sum + # @return [::Google::Cloud::Datastore::V1::AggregationQuery::Aggregation::Sum] + # Sum aggregator. + # @!attribute [rw] avg + # @return [::Google::Cloud::Datastore::V1::AggregationQuery::Aggregation::Avg] + # Average aggregator. + # @!attribute [rw] alias + # @return [::String] + # Optional. Optional name of the property to store the result of the + # aggregation. + # + # If not provided, Datastore will pick a default name following the format + # `property_`. 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 property_1, + # COUNT_UP_TO(3) AS count_up_to_3, + # COUNT(*) AS property_2 + # OVER ( + # ... + # ); + # ``` + # + # Requires: + # + # * Must be unique across all aggregation aliases. + # * Conform to [entity property + # name][google.datastore.v1.Entity.properties] limitations. + class Aggregation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Count of entities that match the query. + # + # The `COUNT(*)` aggregation function operates on the entire entity + # so it does not require a field reference. + # @!attribute [rw] up_to + # @return [::Google::Protobuf::Int64Value] + # Optional. Optional constraint on the maximum number of entities to + # count. + # + # This provides a way to set an upper bound on the number of entities + # to scan, limiting latency, and cost. + # + # Unspecified is interpreted as no bound. + # + # If a zero value is provided, a count result of zero should always be + # expected. + # + # High-Level Example: + # + # ``` + # AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + # ``` + # + # Requires: + # + # * Must be non-negative when present. + class Count + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Sum of the values of the requested property. + # + # * 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] property + # @return [::Google::Cloud::Datastore::V1::PropertyReference] + # The property to aggregate on. + class Sum + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Average of the values of the requested property. + # + # * 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] property + # @return [::Google::Cloud::Datastore::V1::PropertyReference] + # The property to aggregate on. + class Avg + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # A representation of a kind. + # @!attribute [rw] name + # @return [::String] + # The name of the kind. + class KindExpression + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A reference to a property relative to the kind expressions. + # @!attribute [rw] name + # @return [::String] + # A reference to a property. + # + # Requires: + # + # * MUST be a dot-delimited (`.`) string of segments, where each segment + # conforms to {::Google::Cloud::Datastore::V1::Entity#properties entity property name} + # limitations. + class PropertyReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A representation of a property in a projection. + # @!attribute [rw] property + # @return [::Google::Cloud::Datastore::V1::PropertyReference] + # The property to project. + class Projection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The desired order for a specific property. + # @!attribute [rw] property + # @return [::Google::Cloud::Datastore::V1::PropertyReference] + # The property to order by. + # @!attribute [rw] direction + # @return [::Google::Cloud::Datastore::V1::PropertyOrder::Direction] + # The direction to order by. Defaults to `ASCENDING`. + class PropertyOrder + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The sort direction. + module Direction + # Unspecified. This value must not be used. + DIRECTION_UNSPECIFIED = 0 + + # Ascending. + ASCENDING = 1 + + # Descending. + DESCENDING = 2 + end + end + + # A holder for any type of filter. + # @!attribute [rw] composite_filter + # @return [::Google::Cloud::Datastore::V1::CompositeFilter] + # A composite filter. + # @!attribute [rw] property_filter + # @return [::Google::Cloud::Datastore::V1::PropertyFilter] + # A filter on a property. + 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::Datastore::V1::CompositeFilter::Operator] + # The operator for combining multiple filters. + # @!attribute [rw] filters + # @return [::Array<::Google::Cloud::Datastore::V1::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 + + # The results are required to satisfy each 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 property. + # @!attribute [rw] property + # @return [::Google::Cloud::Datastore::V1::PropertyReference] + # The property to filter by. + # @!attribute [rw] op + # @return [::Google::Cloud::Datastore::V1::PropertyFilter::Operator] + # The operator to filter by. + # @!attribute [rw] value + # @return [::Google::Cloud::Datastore::V1::Value] + # The value to compare the property to. + class PropertyFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A property filter operator. + module Operator + # Unspecified. This value must not be used. + OPERATOR_UNSPECIFIED = 0 + + # The given `property` is less than the given `value`. + # + # Requires: + # + # * That `property` comes first in `order_by`. + LESS_THAN = 1 + + # The given `property` is less than or equal to the given `value`. + # + # Requires: + # + # * That `property` comes first in `order_by`. + LESS_THAN_OR_EQUAL = 2 + + # The given `property` is greater than the given `value`. + # + # Requires: + # + # * That `property` comes first in `order_by`. + GREATER_THAN = 3 + + # The given `property` is greater than or equal to the given `value`. + # + # Requires: + # + # * That `property` comes first in `order_by`. + GREATER_THAN_OR_EQUAL = 4 + + # The given `property` is equal to the given `value`. + EQUAL = 5 + + # The given `property` 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` is in the same query. + IN = 6 + + # The given `property` is not equal to the given `value`. + # + # Requires: + # + # * No other `NOT_EQUAL` or `NOT_IN` is in the same query. + # * That `property` comes first in the `order_by`. + NOT_EQUAL = 9 + + # Limit the result set to the given entity and its descendants. + # + # Requires: + # + # * That `value` is an entity key. + # * All evaluated disjunctions must have the same `HAS_ANCESTOR` filter. + HAS_ANCESTOR = 11 + + # The value of the `property` is not in the given array. + # + # Requires: + # + # * That `value` is a non-empty `ArrayValue` with at most 10 values. + # * No other `OR`, `IN`, `NOT_IN`, `NOT_EQUAL` is in the same query. + # * That `field` comes first in the `order_by`. + NOT_IN = 13 + end + end + + # A [GQL + # query](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). + # @!attribute [rw] query_string + # @return [::String] + # A string of the format described + # [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). + # @!attribute [rw] allow_literals + # @return [::Boolean] + # When false, the query string must not contain any literals and instead must + # bind all values. For example, + # `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while + # `SELECT * FROM Kind WHERE a = @value` is. + # @!attribute [rw] named_bindings + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Datastore::V1::GqlQueryParameter}] + # For each non-reserved named binding site in the query string, there must be + # a named parameter with that name, but not necessarily the inverse. + # + # Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex + # `__.*__`, and must not be `""`. + # @!attribute [rw] positional_bindings + # @return [::Array<::Google::Cloud::Datastore::V1::GqlQueryParameter>] + # Numbered binding site @1 references the first numbered parameter, + # effectively using 1-based indexing, rather than the usual 0. + # + # For each binding site numbered i in `query_string`, there must be an i-th + # numbered parameter. The inverse must also be true. + class GqlQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Datastore::V1::GqlQueryParameter] + class NamedBindingsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A binding parameter for a GQL query. + # @!attribute [rw] value + # @return [::Google::Cloud::Datastore::V1::Value] + # A value parameter. + # @!attribute [rw] cursor + # @return [::String] + # A query cursor. Query cursors are returned in query + # result batches. + class GqlQueryParameter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A batch of results produced by a query. + # @!attribute [rw] skipped_results + # @return [::Integer] + # The number of results skipped, typically because of an offset. + # @!attribute [rw] skipped_cursor + # @return [::String] + # A cursor that points to the position after the last skipped result. + # Will be set when `skipped_results` != 0. + # @!attribute [rw] entity_result_type + # @return [::Google::Cloud::Datastore::V1::EntityResult::ResultType] + # The result type for every entity in `entity_results`. + # @!attribute [rw] entity_results + # @return [::Array<::Google::Cloud::Datastore::V1::EntityResult>] + # The results for this batch. + # @!attribute [rw] end_cursor + # @return [::String] + # A cursor that points to the position after the last result in the batch. + # @!attribute [rw] more_results + # @return [::Google::Cloud::Datastore::V1::QueryResultBatch::MoreResultsType] + # The state of the query after the current batch. + # @!attribute [rw] snapshot_version + # @return [::Integer] + # The version number of the snapshot this batch was returned from. + # This applies to the range of results from the query's `start_cursor` (or + # the beginning of the query if no cursor was given) to this batch's + # `end_cursor` (not the query's `end_cursor`). + # + # In a single transaction, subsequent query result batches for the same query + # can have a greater snapshot version number. Each batch's snapshot version + # is valid for all preceding batches. + # The value will be zero for eventually consistent queries. + # @!attribute [rw] read_time + # @return [::Google::Protobuf::Timestamp] + # Read timestamp this batch was returned from. + # This applies to the range of results from the query's `start_cursor` (or + # the beginning of the query if no cursor was given) to this batch's + # `end_cursor` (not the query's `end_cursor`). + # + # In a single transaction, subsequent query result batches for the same query + # can have a greater timestamp. Each batch's read timestamp + # is valid for all preceding batches. + # This value will not be set for eventually consistent queries in Cloud + # Datastore. + class QueryResultBatch + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The possible values for the `more_results` field. + module MoreResultsType + # Unspecified. This value is never used. + MORE_RESULTS_TYPE_UNSPECIFIED = 0 + + # There may be additional batches to fetch from this query. + NOT_FINISHED = 1 + + # The query is finished, but there may be more results after the limit. + MORE_RESULTS_AFTER_LIMIT = 2 + + # The query is finished, but there may be more results after the end + # cursor. + MORE_RESULTS_AFTER_CURSOR = 4 + + # The query is finished, and there are no more results. + NO_MORE_RESULTS = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query_profile.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query_profile.rb new file mode 100644 index 000000000000..8ba0b16599c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query_profile.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Datastore + 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::Datastore::V1::PlanSummary] + # Planning phase information for the query. + # @!attribute [rw] execution_stats + # @return [::Google::Cloud::Datastore::V1::ExecutionStats] + # Aggregated stats from the execution of the query. Only present when + # {::Google::Cloud::Datastore::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-datastore-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..b5731a824060 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..9e96368be9d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/struct.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `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. + # @!attribute [rw] number_value + # @return [::Float] + # Represents a double value. + # @!attribute [rw] string_value + # @return [::String] + # Represents a string value. + # @!attribute [rw] bool_value + # @return [::Boolean] + # Represents a boolean value. + # @!attribute [rw] struct_value + # @return [::Google::Protobuf::Struct] + # Represents a structured value. + # @!attribute [rw] list_value + # @return [::Google::Protobuf::ListValue] + # Represents a repeated `Value`. + 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-datastore-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..4ac9c4801a3f --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..5160138862c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # 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-datastore-v1/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/type/latlng.rb new file mode 100644 index 000000000000..0d9e1c6995f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/type/latlng.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # 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-datastore-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-datastore-v1/snippets/Gemfile new file mode 100644 index 000000000000..ef4adfd7cebc --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-datastore-v1", path: "../" +else + gem "google-cloud-datastore-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-datastore-v1/snippets/datastore/allocate_ids.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/allocate_ids.rb new file mode 100644 index 000000000000..e83f5777eac8 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/allocate_ids.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datastore_v1_generated_Datastore_AllocateIds_sync] +require "google/cloud/datastore/v1" + +## +# Snippet for the allocate_ids call in the Datastore 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::Datastore::V1::Datastore::Client#allocate_ids. +# +def allocate_ids + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::AllocateIdsRequest.new + + # Call the allocate_ids method. + result = client.allocate_ids request + + # The returned object is of type Google::Cloud::Datastore::V1::AllocateIdsResponse. + p result +end +# [END datastore_v1_generated_Datastore_AllocateIds_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/begin_transaction.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/begin_transaction.rb new file mode 100644 index 000000000000..71022abcd3c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/begin_transaction.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datastore_v1_generated_Datastore_BeginTransaction_sync] +require "google/cloud/datastore/v1" + +## +# Snippet for the begin_transaction call in the Datastore 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::Datastore::V1::Datastore::Client#begin_transaction. +# +def begin_transaction + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::BeginTransactionRequest.new + + # Call the begin_transaction method. + result = client.begin_transaction request + + # The returned object is of type Google::Cloud::Datastore::V1::BeginTransactionResponse. + p result +end +# [END datastore_v1_generated_Datastore_BeginTransaction_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/commit.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/commit.rb new file mode 100644 index 000000000000..a4304d2ea44f --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/commit.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datastore_v1_generated_Datastore_Commit_sync] +require "google/cloud/datastore/v1" + +## +# Snippet for the commit call in the Datastore 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::Datastore::V1::Datastore::Client#commit. +# +def commit + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::CommitRequest.new + + # Call the commit method. + result = client.commit request + + # The returned object is of type Google::Cloud::Datastore::V1::CommitResponse. + p result +end +# [END datastore_v1_generated_Datastore_Commit_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/lookup.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/lookup.rb new file mode 100644 index 000000000000..f90ceda5c050 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/lookup.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datastore_v1_generated_Datastore_Lookup_sync] +require "google/cloud/datastore/v1" + +## +# Snippet for the lookup call in the Datastore 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::Datastore::V1::Datastore::Client#lookup. +# +def lookup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::LookupRequest.new + + # Call the lookup method. + result = client.lookup request + + # The returned object is of type Google::Cloud::Datastore::V1::LookupResponse. + p result +end +# [END datastore_v1_generated_Datastore_Lookup_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/reserve_ids.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/reserve_ids.rb new file mode 100644 index 000000000000..5a865df12b73 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/reserve_ids.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datastore_v1_generated_Datastore_ReserveIds_sync] +require "google/cloud/datastore/v1" + +## +# Snippet for the reserve_ids call in the Datastore 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::Datastore::V1::Datastore::Client#reserve_ids. +# +def reserve_ids + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::ReserveIdsRequest.new + + # Call the reserve_ids method. + result = client.reserve_ids request + + # The returned object is of type Google::Cloud::Datastore::V1::ReserveIdsResponse. + p result +end +# [END datastore_v1_generated_Datastore_ReserveIds_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/rollback.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/rollback.rb new file mode 100644 index 000000000000..1264f2b64c82 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/rollback.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datastore_v1_generated_Datastore_Rollback_sync] +require "google/cloud/datastore/v1" + +## +# Snippet for the rollback call in the Datastore 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::Datastore::V1::Datastore::Client#rollback. +# +def rollback + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::RollbackRequest.new + + # Call the rollback method. + result = client.rollback request + + # The returned object is of type Google::Cloud::Datastore::V1::RollbackResponse. + p result +end +# [END datastore_v1_generated_Datastore_Rollback_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_aggregation_query.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_aggregation_query.rb new file mode 100644 index 000000000000..90ddd2aacdcc --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_aggregation_query.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datastore_v1_generated_Datastore_RunAggregationQuery_sync] +require "google/cloud/datastore/v1" + +## +# Snippet for the run_aggregation_query call in the Datastore 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::Datastore::V1::Datastore::Client#run_aggregation_query. +# +def run_aggregation_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new + + # Call the run_aggregation_query method. + result = client.run_aggregation_query request + + # The returned object is of type Google::Cloud::Datastore::V1::RunAggregationQueryResponse. + p result +end +# [END datastore_v1_generated_Datastore_RunAggregationQuery_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_query.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_query.rb new file mode 100644 index 000000000000..312adc5ff186 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_query.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datastore_v1_generated_Datastore_RunQuery_sync] +require "google/cloud/datastore/v1" + +## +# Snippet for the run_query call in the Datastore 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::Datastore::V1::Datastore::Client#run_query. +# +def run_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::RunQueryRequest.new + + # Call the run_query method. + result = client.run_query request + + # The returned object is of type Google::Cloud::Datastore::V1::RunQueryResponse. + p result +end +# [END datastore_v1_generated_Datastore_RunQuery_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/snippet_metadata_google.datastore.v1.json b/owl-bot-staging/google-cloud-datastore-v1/snippets/snippet_metadata_google.datastore.v1.json new file mode 100644 index 000000000000..8fa45d1cb04f --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/snippets/snippet_metadata_google.datastore.v1.json @@ -0,0 +1,335 @@ +{ + "client_library": { + "name": "google-cloud-datastore-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.datastore.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "datastore_v1_generated_Datastore_Lookup_sync", + "title": "Snippet for the lookup call in the Datastore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#lookup.", + "file": "datastore/lookup.rb", + "language": "RUBY", + "client_method": { + "short_name": "lookup", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#lookup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Datastore::V1::LookupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Datastore::V1::LookupResponse", + "client": { + "short_name": "Datastore::Client", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" + }, + "method": { + "short_name": "Lookup", + "full_name": "google.datastore.v1.Datastore.Lookup", + "service": { + "short_name": "Datastore", + "full_name": "google.datastore.v1.Datastore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datastore_v1_generated_Datastore_RunQuery_sync", + "title": "Snippet for the run_query call in the Datastore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#run_query.", + "file": "datastore/run_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_query", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#run_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Datastore::V1::RunQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Datastore::V1::RunQueryResponse", + "client": { + "short_name": "Datastore::Client", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" + }, + "method": { + "short_name": "RunQuery", + "full_name": "google.datastore.v1.Datastore.RunQuery", + "service": { + "short_name": "Datastore", + "full_name": "google.datastore.v1.Datastore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datastore_v1_generated_Datastore_RunAggregationQuery_sync", + "title": "Snippet for the run_aggregation_query call in the Datastore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#run_aggregation_query.", + "file": "datastore/run_aggregation_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_aggregation_query", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#run_aggregation_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Datastore::V1::RunAggregationQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Datastore::V1::RunAggregationQueryResponse", + "client": { + "short_name": "Datastore::Client", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" + }, + "method": { + "short_name": "RunAggregationQuery", + "full_name": "google.datastore.v1.Datastore.RunAggregationQuery", + "service": { + "short_name": "Datastore", + "full_name": "google.datastore.v1.Datastore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datastore_v1_generated_Datastore_BeginTransaction_sync", + "title": "Snippet for the begin_transaction call in the Datastore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction.", + "file": "datastore/begin_transaction.rb", + "language": "RUBY", + "client_method": { + "short_name": "begin_transaction", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Datastore::V1::BeginTransactionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Datastore::V1::BeginTransactionResponse", + "client": { + "short_name": "Datastore::Client", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" + }, + "method": { + "short_name": "BeginTransaction", + "full_name": "google.datastore.v1.Datastore.BeginTransaction", + "service": { + "short_name": "Datastore", + "full_name": "google.datastore.v1.Datastore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datastore_v1_generated_Datastore_Commit_sync", + "title": "Snippet for the commit call in the Datastore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#commit.", + "file": "datastore/commit.rb", + "language": "RUBY", + "client_method": { + "short_name": "commit", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#commit", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Datastore::V1::CommitRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Datastore::V1::CommitResponse", + "client": { + "short_name": "Datastore::Client", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" + }, + "method": { + "short_name": "Commit", + "full_name": "google.datastore.v1.Datastore.Commit", + "service": { + "short_name": "Datastore", + "full_name": "google.datastore.v1.Datastore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datastore_v1_generated_Datastore_Rollback_sync", + "title": "Snippet for the rollback call in the Datastore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#rollback.", + "file": "datastore/rollback.rb", + "language": "RUBY", + "client_method": { + "short_name": "rollback", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#rollback", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Datastore::V1::RollbackRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Datastore::V1::RollbackResponse", + "client": { + "short_name": "Datastore::Client", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" + }, + "method": { + "short_name": "Rollback", + "full_name": "google.datastore.v1.Datastore.Rollback", + "service": { + "short_name": "Datastore", + "full_name": "google.datastore.v1.Datastore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datastore_v1_generated_Datastore_AllocateIds_sync", + "title": "Snippet for the allocate_ids call in the Datastore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#allocate_ids.", + "file": "datastore/allocate_ids.rb", + "language": "RUBY", + "client_method": { + "short_name": "allocate_ids", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#allocate_ids", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Datastore::V1::AllocateIdsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Datastore::V1::AllocateIdsResponse", + "client": { + "short_name": "Datastore::Client", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" + }, + "method": { + "short_name": "AllocateIds", + "full_name": "google.datastore.v1.Datastore.AllocateIds", + "service": { + "short_name": "Datastore", + "full_name": "google.datastore.v1.Datastore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datastore_v1_generated_Datastore_ReserveIds_sync", + "title": "Snippet for the reserve_ids call in the Datastore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#reserve_ids.", + "file": "datastore/reserve_ids.rb", + "language": "RUBY", + "client_method": { + "short_name": "reserve_ids", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#reserve_ids", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Datastore::V1::ReserveIdsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Datastore::V1::ReserveIdsResponse", + "client": { + "short_name": "Datastore::Client", + "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" + }, + "method": { + "short_name": "ReserveIds", + "full_name": "google.datastore.v1.Datastore.ReserveIds", + "service": { + "short_name": "Datastore", + "full_name": "google.datastore.v1.Datastore" + } + } + }, + "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-datastore-v1/test/google/cloud/datastore/v1/datastore_rest_test.rb b/owl-bot-staging/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_rest_test.rb new file mode 100644 index 000000000000..7b193b26d9cb --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_rest_test.rb @@ -0,0 +1,550 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/datastore/v1/datastore_pb" +require "google/cloud/datastore/v1/datastore/rest" + + +class ::Google::Cloud::Datastore::V1::Datastore::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_lookup + # Create test objects. + client_result = ::Google::Cloud::Datastore::V1::LookupResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + database_id = "hello world" + read_options = {} + keys = [{}] + property_mask = {} + + lookup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.stub :transcode_lookup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, lookup_client_stub do + # Create client + client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.lookup({ project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.lookup project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.lookup ::Google::Cloud::Datastore::V1::LookupRequest.new(project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.lookup({ project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.lookup(::Google::Cloud::Datastore::V1::LookupRequest.new(project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, lookup_client_stub.call_count + end + end + end + + def test_run_query + # Create test objects. + client_result = ::Google::Cloud::Datastore::V1::RunQueryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + database_id = "hello world" + partition_id = {} + read_options = {} + query = {} + property_mask = {} + explain_options = {} + + run_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.stub :transcode_run_query_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, run_query_client_stub do + # Create client + client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.run_query project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.run_query ::Google::Cloud::Datastore::V1::RunQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.run_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.run_query(::Google::Cloud::Datastore::V1::RunQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, run_query_client_stub.call_count + end + end + end + + def test_run_aggregation_query + # Create test objects. + client_result = ::Google::Cloud::Datastore::V1::RunAggregationQueryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + database_id = "hello world" + partition_id = {} + read_options = {} + aggregation_query = {} + explain_options = {} + + run_aggregation_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Datastore::V1::Datastore::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::Datastore::V1::Datastore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_aggregation_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.run_aggregation_query project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.run_aggregation_query ::Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.run_aggregation_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.run_aggregation_query(::Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, run_aggregation_query_client_stub.call_count + end + end + end + + def test_begin_transaction + # Create test objects. + client_result = ::Google::Cloud::Datastore::V1::BeginTransactionResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + database_id = "hello world" + transaction_options = {} + + begin_transaction_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.stub :transcode_begin_transaction_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, begin_transaction_client_stub do + # Create client + client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.begin_transaction({ project_id: project_id, database_id: database_id, transaction_options: transaction_options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.begin_transaction project_id: project_id, database_id: database_id, transaction_options: transaction_options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.begin_transaction ::Google::Cloud::Datastore::V1::BeginTransactionRequest.new(project_id: project_id, database_id: database_id, transaction_options: transaction_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.begin_transaction({ project_id: project_id, database_id: database_id, transaction_options: transaction_options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.begin_transaction(::Google::Cloud::Datastore::V1::BeginTransactionRequest.new(project_id: project_id, database_id: database_id, transaction_options: transaction_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::Datastore::V1::CommitResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + database_id = "hello world" + mode = :MODE_UNSPECIFIED + transaction = "hello world" + mutations = [{}] + + commit_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.stub :transcode_commit_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, commit_client_stub do + # Create client + client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.commit({ project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.commit project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.commit ::Google::Cloud::Datastore::V1::CommitRequest.new(project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.commit({ project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.commit(::Google::Cloud::Datastore::V1::CommitRequest.new(project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations), 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::Cloud::Datastore::V1::RollbackResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + database_id = "hello world" + transaction = "hello world" + + rollback_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.stub :transcode_rollback_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, rollback_client_stub do + # Create client + client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.rollback({ project_id: project_id, database_id: database_id, transaction: transaction }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.rollback project_id: project_id, database_id: database_id, transaction: transaction do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.rollback ::Google::Cloud::Datastore::V1::RollbackRequest.new(project_id: project_id, database_id: database_id, transaction: transaction) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.rollback({ project_id: project_id, database_id: database_id, transaction: transaction }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.rollback(::Google::Cloud::Datastore::V1::RollbackRequest.new(project_id: project_id, database_id: database_id, 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_allocate_ids + # Create test objects. + client_result = ::Google::Cloud::Datastore::V1::AllocateIdsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + database_id = "hello world" + keys = [{}] + + allocate_ids_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.stub :transcode_allocate_ids_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, allocate_ids_client_stub do + # Create client + client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.allocate_ids({ project_id: project_id, database_id: database_id, keys: keys }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.allocate_ids project_id: project_id, database_id: database_id, keys: keys do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.allocate_ids ::Google::Cloud::Datastore::V1::AllocateIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.allocate_ids({ project_id: project_id, database_id: database_id, keys: keys }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.allocate_ids(::Google::Cloud::Datastore::V1::AllocateIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, allocate_ids_client_stub.call_count + end + end + end + + def test_reserve_ids + # Create test objects. + client_result = ::Google::Cloud::Datastore::V1::ReserveIdsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + database_id = "hello world" + keys = [{}] + + reserve_ids_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.stub :transcode_reserve_ids_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, reserve_ids_client_stub do + # Create client + client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.reserve_ids({ project_id: project_id, database_id: database_id, keys: keys }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.reserve_ids project_id: project_id, database_id: database_id, keys: keys do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.reserve_ids ::Google::Cloud::Datastore::V1::ReserveIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.reserve_ids({ project_id: project_id, database_id: database_id, keys: keys }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.reserve_ids(::Google::Cloud::Datastore::V1::ReserveIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, reserve_ids_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::Datastore::V1::Datastore::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::Datastore::V1::Datastore::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_test.rb b/owl-bot-staging/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_test.rb new file mode 100644 index 000000000000..8449e52369b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_test.rb @@ -0,0 +1,597 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/datastore/v1/datastore_pb" +require "google/datastore/v1/datastore_services_pb" +require "google/cloud/datastore/v1/datastore" + +class ::Google::Cloud::Datastore::V1::Datastore::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_lookup + # Create GRPC objects. + grpc_response = ::Google::Cloud::Datastore::V1::LookupResponse.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. + project_id = "hello world" + database_id = "hello world" + read_options = {} + keys = [{}] + property_mask = {} + + lookup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :lookup, name + assert_kind_of ::Google::Cloud::Datastore::V1::LookupRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["database_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::ReadOptions), request["read_options"] + assert_kind_of ::Google::Cloud::Datastore::V1::Key, request["keys"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::PropertyMask), request["property_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, lookup_client_stub do + # Create client + client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.lookup({ project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.lookup project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.lookup ::Google::Cloud::Datastore::V1::LookupRequest.new(project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.lookup({ project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.lookup(::Google::Cloud::Datastore::V1::LookupRequest.new(project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, lookup_client_stub.call_rpc_count + end + end + + def test_run_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::Datastore::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 unary method. + project_id = "hello world" + database_id = "hello world" + partition_id = {} + read_options = {} + query = {} + property_mask = {} + explain_options = {} + + run_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :run_query, name + assert_kind_of ::Google::Cloud::Datastore::V1::RunQueryRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["database_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::PartitionId), request["partition_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::ReadOptions), request["read_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::Query), request["query"] + assert_equal :query, request.query_type + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::PropertyMask), request["property_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::ExplainOptions), request["explain_options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_query_client_stub do + # Create client + client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.run_query project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.run_query ::Google::Cloud::Datastore::V1::RunQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.run_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.run_query(::Google::Cloud::Datastore::V1::RunQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, run_query_client_stub.call_rpc_count + end + end + + def test_run_aggregation_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::Datastore::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 unary method. + project_id = "hello world" + database_id = "hello world" + partition_id = {} + read_options = {} + aggregation_query = {} + explain_options = {} + + run_aggregation_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :run_aggregation_query, name + assert_kind_of ::Google::Cloud::Datastore::V1::RunAggregationQueryRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["database_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::PartitionId), request["partition_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::ReadOptions), request["read_options"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::AggregationQuery), request["aggregation_query"] + assert_equal :aggregation_query, request.query_type + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::ExplainOptions), request["explain_options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_aggregation_query_client_stub do + # Create client + client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_aggregation_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.run_aggregation_query project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.run_aggregation_query ::Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.run_aggregation_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.run_aggregation_query(::Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, run_aggregation_query_client_stub.call_rpc_count + end + end + + def test_begin_transaction + # Create GRPC objects. + grpc_response = ::Google::Cloud::Datastore::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. + project_id = "hello world" + database_id = "hello world" + transaction_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::Datastore::V1::BeginTransactionRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["database_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::TransactionOptions), request["transaction_options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, begin_transaction_client_stub do + # Create client + client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.begin_transaction({ project_id: project_id, database_id: database_id, transaction_options: transaction_options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.begin_transaction project_id: project_id, database_id: database_id, transaction_options: transaction_options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.begin_transaction ::Google::Cloud::Datastore::V1::BeginTransactionRequest.new(project_id: project_id, database_id: database_id, transaction_options: transaction_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.begin_transaction({ project_id: project_id, database_id: database_id, transaction_options: transaction_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::Datastore::V1::BeginTransactionRequest.new(project_id: project_id, database_id: database_id, transaction_options: transaction_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::Datastore::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. + project_id = "hello world" + database_id = "hello world" + mode = :MODE_UNSPECIFIED + transaction = "hello world" + mutations = [{}] + + commit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :commit, name + assert_kind_of ::Google::Cloud::Datastore::V1::CommitRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["database_id"] + assert_equal :MODE_UNSPECIFIED, request["mode"] + assert_equal "hello world", request["transaction"] + assert_equal :transaction, request.transaction_selector + assert_kind_of ::Google::Cloud::Datastore::V1::Mutation, request["mutations"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, commit_client_stub do + # Create client + client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.commit({ project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.commit project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.commit ::Google::Cloud::Datastore::V1::CommitRequest.new(project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.commit({ project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations }, 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::Datastore::V1::CommitRequest.new(project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations), 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::Cloud::Datastore::V1::RollbackResponse.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. + project_id = "hello world" + database_id = "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::Datastore::V1::RollbackRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["database_id"] + assert_equal "hello world", request["transaction"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, rollback_client_stub do + # Create client + client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.rollback({ project_id: project_id, database_id: database_id, transaction: transaction }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.rollback project_id: project_id, database_id: database_id, transaction: transaction do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.rollback ::Google::Cloud::Datastore::V1::RollbackRequest.new(project_id: project_id, database_id: database_id, transaction: transaction) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.rollback({ project_id: project_id, database_id: database_id, 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::Datastore::V1::RollbackRequest.new(project_id: project_id, database_id: database_id, 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_allocate_ids + # Create GRPC objects. + grpc_response = ::Google::Cloud::Datastore::V1::AllocateIdsResponse.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. + project_id = "hello world" + database_id = "hello world" + keys = [{}] + + allocate_ids_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :allocate_ids, name + assert_kind_of ::Google::Cloud::Datastore::V1::AllocateIdsRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["database_id"] + assert_kind_of ::Google::Cloud::Datastore::V1::Key, request["keys"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, allocate_ids_client_stub do + # Create client + client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.allocate_ids({ project_id: project_id, database_id: database_id, keys: keys }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.allocate_ids project_id: project_id, database_id: database_id, keys: keys do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.allocate_ids ::Google::Cloud::Datastore::V1::AllocateIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.allocate_ids({ project_id: project_id, database_id: database_id, keys: keys }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.allocate_ids(::Google::Cloud::Datastore::V1::AllocateIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, allocate_ids_client_stub.call_rpc_count + end + end + + def test_reserve_ids + # Create GRPC objects. + grpc_response = ::Google::Cloud::Datastore::V1::ReserveIdsResponse.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. + project_id = "hello world" + database_id = "hello world" + keys = [{}] + + reserve_ids_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reserve_ids, name + assert_kind_of ::Google::Cloud::Datastore::V1::ReserveIdsRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["database_id"] + assert_kind_of ::Google::Cloud::Datastore::V1::Key, request["keys"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, reserve_ids_client_stub do + # Create client + client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.reserve_ids({ project_id: project_id, database_id: database_id, keys: keys }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.reserve_ids project_id: project_id, database_id: database_id, keys: keys do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.reserve_ids ::Google::Cloud::Datastore::V1::ReserveIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.reserve_ids({ project_id: project_id, database_id: database_id, keys: keys }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.reserve_ids(::Google::Cloud::Datastore::V1::ReserveIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, reserve_ids_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::Datastore::V1::Datastore::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::Datastore::V1::Datastore::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-datastore-v1/test/helper.rb b/owl-bot-staging/google-cloud-datastore-v1/test/helper.rb new file mode 100644 index 000000000000..48407bca7edb --- /dev/null +++ b/owl-bot-staging/google-cloud-datastore-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From 78db8432a6c7642f8bd2cc6c6f4e6e38192cc676 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 7 Oct 2024 21:58:21 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../lib/google/datastore/v1/datastore_pb.rb | 5 +- .../google/datastore/v1/datastore.rb | 127 ++ .../google-cloud-datastore-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-datastore-v1/.rubocop.yml | 33 - .../google-cloud-datastore-v1/.toys.rb | 28 - .../google-cloud-datastore-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 -- .../google-cloud-datastore-v1/CHANGELOG.md | 2 - .../google-cloud-datastore-v1/Gemfile | 11 - .../google-cloud-datastore-v1/LICENSE.md | 201 --- .../google-cloud-datastore-v1/README.md | 144 -- .../google-cloud-datastore-v1/Rakefile | 169 --- .../gapic_metadata.json | 58 - .../google-cloud-datastore-v1.gemspec | 28 - .../lib/google-cloud-datastore-v1.rb | 21 - .../lib/google/cloud/datastore/v1.rb | 45 - .../google/cloud/datastore/v1/datastore.rb | 59 - .../cloud/datastore/v1/datastore/client.rb | 1255 ----------------- .../datastore/v1/datastore/credentials.rb | 52 - .../cloud/datastore/v1/datastore/rest.rb | 56 - .../datastore/v1/datastore/rest/client.rb | 1149 --------------- .../v1/datastore/rest/service_stub.rb | 549 ------- .../lib/google/cloud/datastore/v1/rest.rb | 37 - .../lib/google/cloud/datastore/v1/version.rb | 28 - .../datastore/v1/aggregation_result_pb.rb | 49 - .../lib/google/datastore/v1/datastore_pb.rb | 84 -- .../datastore/v1/datastore_services_pb.rb | 68 - .../lib/google/datastore/v1/entity_pb.rb | 53 - .../lib/google/datastore/v1/query_pb.rb | 71 - .../google/datastore/v1/query_profile_pb.rb | 51 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 420 ------ .../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/datastore/v1/aggregation_result.rb | 74 - .../google/datastore/v1/datastore.rb | 709 ---------- .../proto_docs/google/datastore/v1/entity.rb | 235 --- .../proto_docs/google/datastore/v1/query.rb | 584 -------- .../google/datastore/v1/query_profile.rb | 98 -- .../proto_docs/google/protobuf/duration.rb | 98 -- .../proto_docs/google/protobuf/struct.rb | 96 -- .../proto_docs/google/protobuf/timestamp.rb | 127 -- .../proto_docs/google/protobuf/wrappers.rb | 121 -- .../proto_docs/google/type/latlng.rb | 38 - .../snippets/Gemfile | 32 - .../snippets/datastore/allocate_ids.rb | 47 - .../snippets/datastore/begin_transaction.rb | 47 - .../snippets/datastore/commit.rb | 47 - .../snippets/datastore/lookup.rb | 47 - .../snippets/datastore/reserve_ids.rb | 47 - .../snippets/datastore/rollback.rb | 47 - .../datastore/run_aggregation_query.rb | 47 - .../snippets/datastore/run_query.rb | 47 - .../snippet_metadata_google.datastore.v1.json | 335 ----- .../cloud/datastore/v1/datastore_rest_test.rb | 550 -------- .../cloud/datastore/v1/datastore_test.rb | 597 -------- .../google-cloud-datastore-v1/test/helper.rb | 25 - 60 files changed, 131 insertions(+), 9837 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/google-cloud-datastore-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google-cloud-datastore-v1.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/client.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/aggregation_result_pb.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_pb.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/entity_pb.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_pb.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_profile_pb.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/routing.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/aggregation_result.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/datastore.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/entity.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query_profile.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/type/latlng.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/allocate_ids.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/begin_transaction.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/commit.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/lookup.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/reserve_ids.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/rollback.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_aggregation_query.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_query.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/snippets/snippet_metadata_google.datastore.v1.json delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_test.rb delete mode 100644 owl-bot-staging/google-cloud-datastore-v1/test/helper.rb diff --git a/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_pb.rb b/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_pb.rb index 72f3312644b5..6d65402143eb 100644 --- a/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_pb.rb +++ b/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_pb.rb @@ -15,7 +15,7 @@ require 'google/protobuf/timestamp_pb' -descriptor_data = "\n#google/datastore/v1/datastore.proto\x12\x13google.datastore.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x18google/api/routing.proto\x1a,google/datastore/v1/aggregation_result.proto\x1a google/datastore/v1/entity.proto\x1a\x1fgoogle/datastore/v1/query.proto\x1a\'google/datastore/v1/query_profile.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdc\x01\n\rLookupRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x36\n\x0cread_options\x18\x01 \x01(\x0b\x32 .google.datastore.v1.ReadOptions\x12+\n\x04keys\x18\x03 \x03(\x0b\x32\x18.google.datastore.v1.KeyB\x03\xe0\x41\x02\x12\x38\n\rproperty_mask\x18\x05 \x01(\x0b\x32!.google.datastore.v1.PropertyMask\"\xe6\x01\n\x0eLookupResponse\x12\x30\n\x05\x66ound\x18\x01 \x03(\x0b\x32!.google.datastore.v1.EntityResult\x12\x32\n\x07missing\x18\x02 \x03(\x0b\x32!.google.datastore.v1.EntityResult\x12*\n\x08\x64\x65\x66\x65rred\x18\x03 \x03(\x0b\x32\x18.google.datastore.v1.Key\x12\x13\n\x0btransaction\x18\x05 \x01(\x0c\x12-\n\tread_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x9b\x03\n\x0fRunQueryRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x36\n\x0cpartition_id\x18\x02 \x01(\x0b\x32 .google.datastore.v1.PartitionId\x12\x36\n\x0cread_options\x18\x01 \x01(\x0b\x32 .google.datastore.v1.ReadOptions\x12+\n\x05query\x18\x03 \x01(\x0b\x32\x1a.google.datastore.v1.QueryH\x00\x12\x32\n\tgql_query\x18\x07 \x01(\x0b\x32\x1d.google.datastore.v1.GqlQueryH\x00\x12\x38\n\rproperty_mask\x18\n \x01(\x0b\x32!.google.datastore.v1.PropertyMask\x12\x41\n\x0f\x65xplain_options\x18\x0c \x01(\x0b\x32#.google.datastore.v1.ExplainOptionsB\x03\xe0\x41\x01\x42\x0c\n\nquery_type\"\xc6\x01\n\x10RunQueryResponse\x12\x34\n\x05\x62\x61tch\x18\x01 \x01(\x0b\x32%.google.datastore.v1.QueryResultBatch\x12)\n\x05query\x18\x02 \x01(\x0b\x32\x1a.google.datastore.v1.Query\x12\x13\n\x0btransaction\x18\x05 \x01(\x0c\x12<\n\x0f\x65xplain_metrics\x18\t \x01(\x0b\x32#.google.datastore.v1.ExplainMetrics\"\x83\x03\n\x1aRunAggregationQueryRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x36\n\x0cpartition_id\x18\x02 \x01(\x0b\x32 .google.datastore.v1.PartitionId\x12\x36\n\x0cread_options\x18\x01 \x01(\x0b\x32 .google.datastore.v1.ReadOptions\x12\x42\n\x11\x61ggregation_query\x18\x03 \x01(\x0b\x32%.google.datastore.v1.AggregationQueryH\x00\x12\x32\n\tgql_query\x18\x07 \x01(\x0b\x32\x1d.google.datastore.v1.GqlQueryH\x00\x12\x41\n\x0f\x65xplain_options\x18\x0b \x01(\x0b\x32#.google.datastore.v1.ExplainOptionsB\x03\xe0\x41\x01\x42\x0c\n\nquery_type\"\xe2\x01\n\x1bRunAggregationQueryResponse\x12:\n\x05\x62\x61tch\x18\x01 \x01(\x0b\x32+.google.datastore.v1.AggregationResultBatch\x12\x34\n\x05query\x18\x02 \x01(\x0b\x32%.google.datastore.v1.AggregationQuery\x12\x13\n\x0btransaction\x18\x05 \x01(\x0c\x12<\n\x0f\x65xplain_metrics\x18\t \x01(\x0b\x32#.google.datastore.v1.ExplainMetrics\"\x8d\x01\n\x17\x42\x65ginTransactionRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x44\n\x13transaction_options\x18\n \x01(\x0b\x32\'.google.datastore.v1.TransactionOptions\"/\n\x18\x42\x65ginTransactionResponse\x12\x13\n\x0btransaction\x18\x01 \x01(\x0c\"Y\n\x0fRollbackRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x18\n\x0btransaction\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\"\x12\n\x10RollbackResponse\"\xe8\x02\n\rCommitRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x35\n\x04mode\x18\x05 \x01(\x0e\x32\'.google.datastore.v1.CommitRequest.Mode\x12\x15\n\x0btransaction\x18\x01 \x01(\x0cH\x00\x12I\n\x16single_use_transaction\x18\n \x01(\x0b\x32\'.google.datastore.v1.TransactionOptionsH\x00\x12\x30\n\tmutations\x18\x06 \x03(\x0b\x32\x1d.google.datastore.v1.Mutation\"F\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x11\n\rTRANSACTIONAL\x10\x01\x12\x15\n\x11NON_TRANSACTIONAL\x10\x02\x42\x16\n\x14transaction_selector\"\x97\x01\n\x0e\x43ommitResponse\x12=\n\x10mutation_results\x18\x03 \x03(\x0b\x32#.google.datastore.v1.MutationResult\x12\x15\n\rindex_updates\x18\x04 \x01(\x05\x12/\n\x0b\x63ommit_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"o\n\x12\x41llocateIdsRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12+\n\x04keys\x18\x01 \x03(\x0b\x32\x18.google.datastore.v1.KeyB\x03\xe0\x41\x02\"=\n\x13\x41llocateIdsResponse\x12&\n\x04keys\x18\x01 \x03(\x0b\x32\x18.google.datastore.v1.Key\"n\n\x11ReserveIdsRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12+\n\x04keys\x18\x01 \x03(\x0b\x32\x18.google.datastore.v1.KeyB\x03\xe0\x41\x02\"\x14\n\x12ReserveIdsResponse\"\xf4\x02\n\x08Mutation\x12-\n\x06insert\x18\x04 \x01(\x0b\x32\x1b.google.datastore.v1.EntityH\x00\x12-\n\x06update\x18\x05 \x01(\x0b\x32\x1b.google.datastore.v1.EntityH\x00\x12-\n\x06upsert\x18\x06 \x01(\x0b\x32\x1b.google.datastore.v1.EntityH\x00\x12*\n\x06\x64\x65lete\x18\x07 \x01(\x0b\x32\x18.google.datastore.v1.KeyH\x00\x12\x16\n\x0c\x62\x61se_version\x18\x08 \x01(\x03H\x01\x12\x31\n\x0bupdate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12\x38\n\rproperty_mask\x18\t \x01(\x0b\x32!.google.datastore.v1.PropertyMaskB\x0b\n\toperationB\x1d\n\x1b\x63onflict_detection_strategy\"\xc5\x01\n\x0eMutationResult\x12%\n\x03key\x18\x03 \x01(\x0b\x32\x18.google.datastore.v1.Key\x12\x0f\n\x07version\x18\x04 \x01(\x03\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x19\n\x11\x63onflict_detected\x18\x05 \x01(\x08\"\x1d\n\x0cPropertyMask\x12\r\n\x05paths\x18\x01 \x03(\t\"\xca\x02\n\x0bReadOptions\x12L\n\x10read_consistency\x18\x01 \x01(\x0e\x32\x30.google.datastore.v1.ReadOptions.ReadConsistencyH\x00\x12\x15\n\x0btransaction\x18\x02 \x01(\x0cH\x00\x12\x42\n\x0fnew_transaction\x18\x03 \x01(\x0b\x32\'.google.datastore.v1.TransactionOptionsH\x00\x12/\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\"M\n\x0fReadConsistency\x12 \n\x1cREAD_CONSISTENCY_UNSPECIFIED\x10\x00\x12\n\n\x06STRONG\x10\x01\x12\x0c\n\x08\x45VENTUAL\x10\x02\x42\x12\n\x10\x63onsistency_type\"\x92\x02\n\x12TransactionOptions\x12G\n\nread_write\x18\x01 \x01(\x0b\x32\x31.google.datastore.v1.TransactionOptions.ReadWriteH\x00\x12\x45\n\tread_only\x18\x02 \x01(\x0b\x32\x30.google.datastore.v1.TransactionOptions.ReadOnlyH\x00\x1a)\n\tReadWrite\x12\x1c\n\x14previous_transaction\x18\x01 \x01(\x0c\x1a\x39\n\x08ReadOnly\x12-\n\tread_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\n\x04mode2\xe1\r\n\tDatastore\x12\xc0\x01\n\x06Lookup\x12\".google.datastore.v1.LookupRequest\x1a#.google.datastore.v1.LookupResponse\"m\xda\x41\x1cproject_id,read_options,keys\x82\xd3\xe4\x93\x02%\" /v1/projects/{project_id}:lookup:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xa9\x01\n\x08RunQuery\x12$.google.datastore.v1.RunQueryRequest\x1a%.google.datastore.v1.RunQueryResponse\"P\x82\xd3\xe4\x93\x02\'\"\"/v1/projects/{project_id}:runQuery:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xd5\x01\n\x13RunAggregationQuery\x12/.google.datastore.v1.RunAggregationQueryRequest\x1a\x30.google.datastore.v1.RunAggregationQueryResponse\"[\x82\xd3\xe4\x93\x02\x32\"-/v1/projects/{project_id}:runAggregationQuery:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xd6\x01\n\x10\x42\x65ginTransaction\x12,.google.datastore.v1.BeginTransactionRequest\x1a-.google.datastore.v1.BeginTransactionResponse\"e\xda\x41\nproject_id\x82\xd3\xe4\x93\x02/\"*/v1/projects/{project_id}:beginTransaction:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xe6\x01\n\x06\x43ommit\x12\".google.datastore.v1.CommitRequest\x1a#.google.datastore.v1.CommitResponse\"\x92\x01\xda\x41%project_id,mode,transaction,mutations\xda\x41\x19project_id,mode,mutations\x82\xd3\xe4\x93\x02%\" /v1/projects/{project_id}:commit:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xc2\x01\n\x08Rollback\x12$.google.datastore.v1.RollbackRequest\x1a%.google.datastore.v1.RollbackResponse\"i\xda\x41\x16project_id,transaction\x82\xd3\xe4\x93\x02\'\"\"/v1/projects/{project_id}:rollback:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xc7\x01\n\x0b\x41llocateIds\x12\'.google.datastore.v1.AllocateIdsRequest\x1a(.google.datastore.v1.AllocateIdsResponse\"e\xda\x41\x0fproject_id,keys\x82\xd3\xe4\x93\x02*\"%/v1/projects/{project_id}:allocateIds:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xc3\x01\n\nReserveIds\x12&.google.datastore.v1.ReserveIdsRequest\x1a\'.google.datastore.v1.ReserveIdsResponse\"d\xda\x41\x0fproject_id,keys\x82\xd3\xe4\x93\x02)\"$/v1/projects/{project_id}:reserveIds:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x1av\xca\x41\x18\x64\x61tastore.googleapis.com\xd2\x41Xhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastoreB\xbf\x01\n\x17\x63om.google.datastore.v1B\x0e\x44\x61tastoreProtoP\x01Z;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb\xaa\x02\x19Google.Cloud.Datastore.V1\xca\x02\x19Google\\Cloud\\Datastore\\V1\xea\x02\x1cGoogle::Cloud::Datastore::V1b\x06proto3" +descriptor_data = "\n#google/datastore/v1/datastore.proto\x12\x13google.datastore.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x18google/api/routing.proto\x1a,google/datastore/v1/aggregation_result.proto\x1a google/datastore/v1/entity.proto\x1a\x1fgoogle/datastore/v1/query.proto\x1a\'google/datastore/v1/query_profile.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdc\x01\n\rLookupRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x36\n\x0cread_options\x18\x01 \x01(\x0b\x32 .google.datastore.v1.ReadOptions\x12+\n\x04keys\x18\x03 \x03(\x0b\x32\x18.google.datastore.v1.KeyB\x03\xe0\x41\x02\x12\x38\n\rproperty_mask\x18\x05 \x01(\x0b\x32!.google.datastore.v1.PropertyMask\"\xe6\x01\n\x0eLookupResponse\x12\x30\n\x05\x66ound\x18\x01 \x03(\x0b\x32!.google.datastore.v1.EntityResult\x12\x32\n\x07missing\x18\x02 \x03(\x0b\x32!.google.datastore.v1.EntityResult\x12*\n\x08\x64\x65\x66\x65rred\x18\x03 \x03(\x0b\x32\x18.google.datastore.v1.Key\x12\x13\n\x0btransaction\x18\x05 \x01(\x0c\x12-\n\tread_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x9b\x03\n\x0fRunQueryRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x36\n\x0cpartition_id\x18\x02 \x01(\x0b\x32 .google.datastore.v1.PartitionId\x12\x36\n\x0cread_options\x18\x01 \x01(\x0b\x32 .google.datastore.v1.ReadOptions\x12+\n\x05query\x18\x03 \x01(\x0b\x32\x1a.google.datastore.v1.QueryH\x00\x12\x32\n\tgql_query\x18\x07 \x01(\x0b\x32\x1d.google.datastore.v1.GqlQueryH\x00\x12\x38\n\rproperty_mask\x18\n \x01(\x0b\x32!.google.datastore.v1.PropertyMask\x12\x41\n\x0f\x65xplain_options\x18\x0c \x01(\x0b\x32#.google.datastore.v1.ExplainOptionsB\x03\xe0\x41\x01\x42\x0c\n\nquery_type\"\xc6\x01\n\x10RunQueryResponse\x12\x34\n\x05\x62\x61tch\x18\x01 \x01(\x0b\x32%.google.datastore.v1.QueryResultBatch\x12)\n\x05query\x18\x02 \x01(\x0b\x32\x1a.google.datastore.v1.Query\x12\x13\n\x0btransaction\x18\x05 \x01(\x0c\x12<\n\x0f\x65xplain_metrics\x18\t \x01(\x0b\x32#.google.datastore.v1.ExplainMetrics\"\x83\x03\n\x1aRunAggregationQueryRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x36\n\x0cpartition_id\x18\x02 \x01(\x0b\x32 .google.datastore.v1.PartitionId\x12\x36\n\x0cread_options\x18\x01 \x01(\x0b\x32 .google.datastore.v1.ReadOptions\x12\x42\n\x11\x61ggregation_query\x18\x03 \x01(\x0b\x32%.google.datastore.v1.AggregationQueryH\x00\x12\x32\n\tgql_query\x18\x07 \x01(\x0b\x32\x1d.google.datastore.v1.GqlQueryH\x00\x12\x41\n\x0f\x65xplain_options\x18\x0b \x01(\x0b\x32#.google.datastore.v1.ExplainOptionsB\x03\xe0\x41\x01\x42\x0c\n\nquery_type\"\xe2\x01\n\x1bRunAggregationQueryResponse\x12:\n\x05\x62\x61tch\x18\x01 \x01(\x0b\x32+.google.datastore.v1.AggregationResultBatch\x12\x34\n\x05query\x18\x02 \x01(\x0b\x32%.google.datastore.v1.AggregationQuery\x12\x13\n\x0btransaction\x18\x05 \x01(\x0c\x12<\n\x0f\x65xplain_metrics\x18\t \x01(\x0b\x32#.google.datastore.v1.ExplainMetrics\"\x8d\x01\n\x17\x42\x65ginTransactionRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x44\n\x13transaction_options\x18\n \x01(\x0b\x32\'.google.datastore.v1.TransactionOptions\"/\n\x18\x42\x65ginTransactionResponse\x12\x13\n\x0btransaction\x18\x01 \x01(\x0c\"Y\n\x0fRollbackRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x18\n\x0btransaction\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\"\x12\n\x10RollbackResponse\"\xe8\x02\n\rCommitRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x35\n\x04mode\x18\x05 \x01(\x0e\x32\'.google.datastore.v1.CommitRequest.Mode\x12\x15\n\x0btransaction\x18\x01 \x01(\x0cH\x00\x12I\n\x16single_use_transaction\x18\n \x01(\x0b\x32\'.google.datastore.v1.TransactionOptionsH\x00\x12\x30\n\tmutations\x18\x06 \x03(\x0b\x32\x1d.google.datastore.v1.Mutation\"F\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x11\n\rTRANSACTIONAL\x10\x01\x12\x15\n\x11NON_TRANSACTIONAL\x10\x02\x42\x16\n\x14transaction_selector\"\x97\x01\n\x0e\x43ommitResponse\x12=\n\x10mutation_results\x18\x03 \x03(\x0b\x32#.google.datastore.v1.MutationResult\x12\x15\n\rindex_updates\x18\x04 \x01(\x05\x12/\n\x0b\x63ommit_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"o\n\x12\x41llocateIdsRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12+\n\x04keys\x18\x01 \x03(\x0b\x32\x18.google.datastore.v1.KeyB\x03\xe0\x41\x02\"=\n\x13\x41llocateIdsResponse\x12&\n\x04keys\x18\x01 \x03(\x0b\x32\x18.google.datastore.v1.Key\"n\n\x11ReserveIdsRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12+\n\x04keys\x18\x01 \x03(\x0b\x32\x18.google.datastore.v1.KeyB\x03\xe0\x41\x02\"\x14\n\x12ReserveIdsResponse\"\xf2\x04\n\x08Mutation\x12-\n\x06insert\x18\x04 \x01(\x0b\x32\x1b.google.datastore.v1.EntityH\x00\x12-\n\x06update\x18\x05 \x01(\x0b\x32\x1b.google.datastore.v1.EntityH\x00\x12-\n\x06upsert\x18\x06 \x01(\x0b\x32\x1b.google.datastore.v1.EntityH\x00\x12*\n\x06\x64\x65lete\x18\x07 \x01(\x0b\x32\x18.google.datastore.v1.KeyH\x00\x12\x16\n\x0c\x62\x61se_version\x18\x08 \x01(\x03H\x01\x12\x31\n\x0bupdate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12^\n\x1c\x63onflict_resolution_strategy\x18\n \x01(\x0e\x32\x38.google.datastore.v1.Mutation.ConflictResolutionStrategy\x12\x38\n\rproperty_mask\x18\t \x01(\x0b\x32!.google.datastore.v1.PropertyMask\x12H\n\x13property_transforms\x18\x0c \x03(\x0b\x32&.google.datastore.v1.PropertyTransformB\x03\xe0\x41\x01\"R\n\x1a\x43onflictResolutionStrategy\x12\x18\n\x14STRATEGY_UNSPECIFIED\x10\x00\x12\x10\n\x0cSERVER_VALUE\x10\x01\x12\x08\n\x04\x46\x41IL\x10\x03\x42\x0b\n\toperationB\x1d\n\x1b\x63onflict_detection_strategy\"\xe3\x03\n\x11PropertyTransform\x12\x15\n\x08property\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12Q\n\x13set_to_server_value\x18\x02 \x01(\x0e\x32\x32.google.datastore.v1.PropertyTransform.ServerValueH\x00\x12/\n\tincrement\x18\x03 \x01(\x0b\x32\x1a.google.datastore.v1.ValueH\x00\x12-\n\x07maximum\x18\x04 \x01(\x0b\x32\x1a.google.datastore.v1.ValueH\x00\x12-\n\x07minimum\x18\x05 \x01(\x0b\x32\x1a.google.datastore.v1.ValueH\x00\x12\x42\n\x17\x61ppend_missing_elements\x18\x06 \x01(\x0b\x32\x1f.google.datastore.v1.ArrayValueH\x00\x12@\n\x15remove_all_from_array\x18\x07 \x01(\x0b\x32\x1f.google.datastore.v1.ArrayValueH\x00\"=\n\x0bServerValue\x12\x1c\n\x18SERVER_VALUE_UNSPECIFIED\x10\x00\x12\x10\n\x0cREQUEST_TIME\x10\x01\x42\x10\n\x0etransform_type\"\xfc\x01\n\x0eMutationResult\x12%\n\x03key\x18\x03 \x01(\x0b\x32\x18.google.datastore.v1.Key\x12\x0f\n\x07version\x18\x04 \x01(\x03\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x19\n\x11\x63onflict_detected\x18\x05 \x01(\x08\x12\x35\n\x11transform_results\x18\x08 \x03(\x0b\x32\x1a.google.datastore.v1.Value\"\x1d\n\x0cPropertyMask\x12\r\n\x05paths\x18\x01 \x03(\t\"\xca\x02\n\x0bReadOptions\x12L\n\x10read_consistency\x18\x01 \x01(\x0e\x32\x30.google.datastore.v1.ReadOptions.ReadConsistencyH\x00\x12\x15\n\x0btransaction\x18\x02 \x01(\x0cH\x00\x12\x42\n\x0fnew_transaction\x18\x03 \x01(\x0b\x32\'.google.datastore.v1.TransactionOptionsH\x00\x12/\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\"M\n\x0fReadConsistency\x12 \n\x1cREAD_CONSISTENCY_UNSPECIFIED\x10\x00\x12\n\n\x06STRONG\x10\x01\x12\x0c\n\x08\x45VENTUAL\x10\x02\x42\x12\n\x10\x63onsistency_type\"\x92\x02\n\x12TransactionOptions\x12G\n\nread_write\x18\x01 \x01(\x0b\x32\x31.google.datastore.v1.TransactionOptions.ReadWriteH\x00\x12\x45\n\tread_only\x18\x02 \x01(\x0b\x32\x30.google.datastore.v1.TransactionOptions.ReadOnlyH\x00\x1a)\n\tReadWrite\x12\x1c\n\x14previous_transaction\x18\x01 \x01(\x0c\x1a\x39\n\x08ReadOnly\x12-\n\tread_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\n\x04mode2\xe1\r\n\tDatastore\x12\xc0\x01\n\x06Lookup\x12\".google.datastore.v1.LookupRequest\x1a#.google.datastore.v1.LookupResponse\"m\xda\x41\x1cproject_id,read_options,keys\x82\xd3\xe4\x93\x02%\" /v1/projects/{project_id}:lookup:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xa9\x01\n\x08RunQuery\x12$.google.datastore.v1.RunQueryRequest\x1a%.google.datastore.v1.RunQueryResponse\"P\x82\xd3\xe4\x93\x02\'\"\"/v1/projects/{project_id}:runQuery:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xd5\x01\n\x13RunAggregationQuery\x12/.google.datastore.v1.RunAggregationQueryRequest\x1a\x30.google.datastore.v1.RunAggregationQueryResponse\"[\x82\xd3\xe4\x93\x02\x32\"-/v1/projects/{project_id}:runAggregationQuery:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xd6\x01\n\x10\x42\x65ginTransaction\x12,.google.datastore.v1.BeginTransactionRequest\x1a-.google.datastore.v1.BeginTransactionResponse\"e\xda\x41\nproject_id\x82\xd3\xe4\x93\x02/\"*/v1/projects/{project_id}:beginTransaction:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xe6\x01\n\x06\x43ommit\x12\".google.datastore.v1.CommitRequest\x1a#.google.datastore.v1.CommitResponse\"\x92\x01\xda\x41%project_id,mode,transaction,mutations\xda\x41\x19project_id,mode,mutations\x82\xd3\xe4\x93\x02%\" /v1/projects/{project_id}:commit:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xc2\x01\n\x08Rollback\x12$.google.datastore.v1.RollbackRequest\x1a%.google.datastore.v1.RollbackResponse\"i\xda\x41\x16project_id,transaction\x82\xd3\xe4\x93\x02\'\"\"/v1/projects/{project_id}:rollback:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xc7\x01\n\x0b\x41llocateIds\x12\'.google.datastore.v1.AllocateIdsRequest\x1a(.google.datastore.v1.AllocateIdsResponse\"e\xda\x41\x0fproject_id,keys\x82\xd3\xe4\x93\x02*\"%/v1/projects/{project_id}:allocateIds:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xc3\x01\n\nReserveIds\x12&.google.datastore.v1.ReserveIdsRequest\x1a\'.google.datastore.v1.ReserveIdsResponse\"d\xda\x41\x0fproject_id,keys\x82\xd3\xe4\x93\x02)\"$/v1/projects/{project_id}:reserveIds:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x1av\xca\x41\x18\x64\x61tastore.googleapis.com\xd2\x41Xhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastoreB\xbf\x01\n\x17\x63om.google.datastore.v1B\x0e\x44\x61tastoreProtoP\x01Z;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb\xaa\x02\x19Google.Cloud.Datastore.V1\xca\x02\x19Google\\Cloud\\Datastore\\V1\xea\x02\x1cGoogle::Cloud::Datastore::V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -68,6 +68,9 @@ module V1 ReserveIdsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ReserveIdsRequest").msgclass ReserveIdsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ReserveIdsResponse").msgclass Mutation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Mutation").msgclass + Mutation::ConflictResolutionStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Mutation.ConflictResolutionStrategy").enummodule + PropertyTransform = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyTransform").msgclass + PropertyTransform::ServerValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyTransform.ServerValue").enummodule MutationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.MutationResult").msgclass PropertyMask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyMask").msgclass ReadOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ReadOptions").msgclass diff --git a/google-cloud-datastore-v1/proto_docs/google/datastore/v1/datastore.rb b/google-cloud-datastore-v1/proto_docs/google/datastore/v1/datastore.rb index 60c1c1cd4d4d..458298f2337c 100644 --- a/google-cloud-datastore-v1/proto_docs/google/datastore/v1/datastore.rb +++ b/google-cloud-datastore-v1/proto_docs/google/datastore/v1/datastore.rb @@ -429,6 +429,11 @@ class ReserveIdsResponse # The update time of the entity that this mutation is being applied # to. If this does not match the current update time on the server, the # mutation conflicts. + # @!attribute [rw] conflict_resolution_strategy + # @return [::Google::Cloud::Datastore::V1::Mutation::ConflictResolutionStrategy] + # The strategy to use when a conflict is detected. Defaults to + # `SERVER_VALUE`. + # If this is set, then `conflict_detection_strategy` must also be set. # @!attribute [rw] property_mask # @return [::Google::Cloud::Datastore::V1::PropertyMask] # The properties to write in this mutation. @@ -439,9 +444,126 @@ class ReserveIdsResponse # If the entity already exists, only properties referenced in the mask are # updated, others are left untouched. # Properties referenced in the mask but not in the entity are deleted. + # @!attribute [rw] property_transforms + # @return [::Array<::Google::Cloud::Datastore::V1::PropertyTransform>] + # Optional. The transforms to perform on the entity. + # + # This field can be set only when the operation is `insert`, `update`, + # or `upsert`. If present, the transforms are be applied to the entity + # regardless of the property mask, in order, after the operation. class Mutation include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods + + # The possible ways to resolve a conflict detected in a mutation. + module ConflictResolutionStrategy + # Unspecified. Defaults to `SERVER_VALUE`. + STRATEGY_UNSPECIFIED = 0 + + # The server entity is kept. + SERVER_VALUE = 1 + + # The whole commit request fails. + FAIL = 3 + end + end + + # A transformation of an entity property. + # @!attribute [rw] property + # @return [::String] + # Optional. The name of the property. + # + # Property paths (a list of property names separated by dots (`.`)) may be + # used to refer to properties inside entity values. For example `foo.bar` + # means the property `bar` inside the entity property `foo`. + # + # If a property name contains a dot `.` or a backlslash `\`, then that name + # must be escaped. + # @!attribute [rw] set_to_server_value + # @return [::Google::Cloud::Datastore::V1::PropertyTransform::ServerValue] + # Sets the property to the given server value. + # @!attribute [rw] increment + # @return [::Google::Cloud::Datastore::V1::Value] + # Adds the given value to the property's current value. + # + # This must be an integer or a double value. + # If the property is not an integer or double, or if the property does not + # yet exist, the transformation will set the property to the given value. + # If either of the given value or the current property value are doubles, + # both values will be interpreted as doubles. Double arithmetic and + # representation of double values follows IEEE 754 semantics. + # If there is positive/negative integer overflow, the property is resolved + # to the largest magnitude positive/negative integer. + # @!attribute [rw] maximum + # @return [::Google::Cloud::Datastore::V1::Value] + # Sets the property to the maximum of its current value and the given + # value. + # + # This must be an integer or a double value. + # If the property is not an integer or double, or if the property does not + # yet exist, the transformation will set the property to the given value. + # If a maximum operation is applied where the property and the input value + # are of mixed types (that is - one is an integer and one is a double) + # the property takes on the type of the larger operand. If the operands are + # equivalent (e.g. 3 and 3.0), the property 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. + # @!attribute [rw] minimum + # @return [::Google::Cloud::Datastore::V1::Value] + # Sets the property to the minimum of its current value and the given + # value. + # + # This must be an integer or a double value. + # If the property is not an integer or double, or if the property does not + # yet exist, the transformation will set the property to the input value. + # If a minimum operation is applied where the property and the input value + # are of mixed types (that is - one is an integer and one is a double) + # the property takes on the type of the smaller operand. If the operands + # are equivalent (e.g. 3 and 3.0), the property 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. + # @!attribute [rw] append_missing_elements + # @return [::Google::Cloud::Datastore::V1::ArrayValue] + # Appends the given elements in order if they are not already present in + # the current property value. + # If the property is not an array, or if the property 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 the null value is equal to the null value. + # If the input contains multiple equivalent values, only the first will + # be considered. + # + # The corresponding transform result will be the null value. + # @!attribute [rw] remove_all_from_array + # @return [::Google::Cloud::Datastore::V1::ArrayValue] + # Removes all of the given elements from the array in the property. + # If the property is not an array, or if the property does not yet exist, + # it is set to the empty array. + # + # Equivalent numbers of 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 the null value is equal to the null value. + # This will remove all equivalent values if there are duplicates. + # + # The corresponding transform result will be the null value. + class PropertyTransform + 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 properties (same or different entities) + # in a transaction, all the properties will get the same server timestamp. + REQUEST_TIME = 1 + end end # The result of applying a mutation. @@ -469,6 +591,11 @@ class Mutation # @return [::Boolean] # Whether a conflict was detected for this mutation. Always false when a # conflict detection strategy field is not set in the mutation. + # @!attribute [rw] transform_results + # @return [::Array<::Google::Cloud::Datastore::V1::Value>] + # The results of applying each + # {::Google::Cloud::Datastore::V1::PropertyTransform PropertyTransform}, in the same + # order of the request. class MutationResult include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/owl-bot-staging/google-cloud-datastore-v1/.gitignore b/owl-bot-staging/google-cloud-datastore-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-datastore-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-datastore-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-datastore-v1/.repo-metadata.json deleted file mode 100644 index 9bba836c8677..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "datastore.googleapis.com", - "api_shortname": "datastore", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-datastore-v1/latest", - "distribution_name": "google-cloud-datastore-v1", - "is_cloud": true, - "language": "ruby", - "name": "datastore", - "name_pretty": "Firestore in Datastore mode V1 API", - "product_documentation": "https://cloud.google.com/datastore", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Firestore in Datastore mode is a NoSQL document database built for automatic scaling, high performance, and ease of application development. Note that google-cloud-datastore-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-datastore instead. See the readme for more details.", - "ruby-cloud-env-prefix": "DATASTORE", - "ruby-cloud-product-url": "https://cloud.google.com/datastore", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-datastore-v1/.rubocop.yml b/owl-bot-staging/google-cloud-datastore-v1/.rubocop.yml deleted file mode 100644 index a97721ccf44b..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-datastore-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-datastore-v1.rb" diff --git a/owl-bot-staging/google-cloud-datastore-v1/.toys.rb b/owl-bot-staging/google-cloud-datastore-v1/.toys.rb deleted file mode 100644 index 23434bdd5d5b..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/.yardopts b/owl-bot-staging/google-cloud-datastore-v1/.yardopts deleted file mode 100644 index 7f28ed4699e2..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Firestore in Datastore mode 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-datastore-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-datastore-v1/AUTHENTICATION.md deleted file mode 100644 index 3101d97ff3de..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-datastore-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-datastore-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/datastore/v1" - -client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/datastore/v1" - -::Google::Cloud::Datastore::V1::Datastore::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Datastore::V1::Datastore::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-datastore-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/datastore/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Datastore::V1::Datastore::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-datastore-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-datastore-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-datastore-v1/Gemfile b/owl-bot-staging/google-cloud-datastore-v1/Gemfile deleted file mode 100644 index 95163a6d11f8..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.27.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-datastore-v1/LICENSE.md b/owl-bot-staging/google-cloud-datastore-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-datastore-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-datastore-v1/README.md b/owl-bot-staging/google-cloud-datastore-v1/README.md deleted file mode 100644 index cd1bd7f8c09d..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/README.md +++ /dev/null @@ -1,144 +0,0 @@ -# Ruby Client for the Firestore in Datastore mode V1 API - -Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application. - -Firestore in Datastore mode 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 Firestore in Datastore mode V1 API. Most users should consider using -the main client gem, -[google-cloud-datastore](https://rubygems.org/gems/google-cloud-datastore). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-datastore-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/datastore.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/datastore/v1" - -client = ::Google::Cloud::Datastore::V1::Datastore::Client.new -request = ::Google::Cloud::Datastore::V1::LookupRequest.new # (request fields as keyword arguments...) -response = client.lookup request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-datastore-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/datastore) -for general usage information. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.7+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-datastore`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-datastore-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-datastore`. -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-datastore-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-datastore-v1/Rakefile b/owl-bot-staging/google-cloud-datastore-v1/Rakefile deleted file mode 100644 index e2fd1bae691f..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-datastore-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["DATASTORE_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["DATASTORE_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["DATASTORE_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 DATASTORE_TEST_PROJECT=test123 DATASTORE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/datastore/v1/datastore/credentials" - ::Google::Cloud::Datastore::V1::Datastore::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["DATASTORE_PROJECT"] = project - ENV["DATASTORE_TEST_PROJECT"] = project - ENV["DATASTORE_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-datastore-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-datastore-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-datastore-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-datastore-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-datastore-v1" - header "google-cloud-datastore-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-datastore-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-datastore-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-datastore-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-datastore-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-datastore-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-datastore-v1/gapic_metadata.json deleted file mode 100644 index 92700b0184ee..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/gapic_metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.datastore.v1", - "libraryPackage": "::Google::Cloud::Datastore::V1", - "services": { - "Datastore": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Datastore::V1::Datastore::Client", - "rpcs": { - "Lookup": { - "methods": [ - "lookup" - ] - }, - "RunQuery": { - "methods": [ - "run_query" - ] - }, - "RunAggregationQuery": { - "methods": [ - "run_aggregation_query" - ] - }, - "BeginTransaction": { - "methods": [ - "begin_transaction" - ] - }, - "Commit": { - "methods": [ - "commit" - ] - }, - "Rollback": { - "methods": [ - "rollback" - ] - }, - "AllocateIds": { - "methods": [ - "allocate_ids" - ] - }, - "ReserveIds": { - "methods": [ - "reserve_ids" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-datastore-v1/google-cloud-datastore-v1.gemspec b/owl-bot-staging/google-cloud-datastore-v1/google-cloud-datastore-v1.gemspec deleted file mode 100644 index cd1f7712098a..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/google-cloud-datastore-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/datastore/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-datastore-v1" - gem.version = Google::Cloud::Datastore::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Firestore in Datastore mode is a NoSQL document database built for automatic scaling, high performance, and ease of application development. Note that google-cloud-datastore-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-datastore instead. See the readme for more details." - gem.summary = "Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 2.7" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google-cloud-datastore-v1.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google-cloud-datastore-v1.rb deleted file mode 100644 index 5818a4440c3a..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google-cloud-datastore-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/datastore/v1" diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1.rb deleted file mode 100644 index 837a9c5b7739..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/datastore/v1/datastore" -require "google/cloud/datastore/v1/version" - -module Google - module Cloud - module Datastore - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/datastore/v1" - # client = ::Google::Cloud::Datastore::V1::Datastore::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/datastore/v1" - # client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/datastore/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore.rb deleted file mode 100644 index 021f80de0d6e..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/datastore/v1/version" - -require "google/cloud/datastore/v1/datastore/credentials" -require "google/cloud/datastore/v1/datastore/client" -require "google/cloud/datastore/v1/datastore/rest" - -module Google - module Cloud - module Datastore - module V1 - ## - # Each RPC normalizes the partition IDs of the keys in its input entities, - # and always returns entities with keys with normalized partition IDs. - # This applies to all keys and entities, including those in values, except keys - # with both an empty path and an empty or unset partition ID. Normalization of - # input keys sets the project ID (if not already set) to the project ID from - # the request. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/datastore/v1/datastore" - # client = ::Google::Cloud::Datastore::V1::Datastore::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/datastore/v1/datastore/rest" - # client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new - # - module Datastore - end - end - end - end -end - -helper_path = ::File.join __dir__, "datastore", "helpers.rb" -require "google/cloud/datastore/v1/datastore/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/client.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/client.rb deleted file mode 100644 index 584ecd373f0d..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/client.rb +++ /dev/null @@ -1,1255 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/datastore/v1/datastore_pb" - -module Google - module Cloud - module Datastore - module V1 - module Datastore - ## - # Client for the Datastore service. - # - # Each RPC normalizes the partition IDs of the keys in its input entities, - # and always returns entities with keys with normalized partition IDs. - # This applies to all keys and entities, including those in values, except keys - # with both an empty path and an empty or unset partition ID. Normalization of - # input keys sets the project ID (if not already set) to the project ID from - # the request. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "datastore.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :datastore_stub - - ## - # Configure the Datastore Client class. - # - # See {::Google::Cloud::Datastore::V1::Datastore::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Datastore clients - # ::Google::Cloud::Datastore::V1::Datastore::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", "Datastore", "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.lookup.timeout = 60.0 - default_config.rpcs.lookup.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.run_query.timeout = 60.0 - default_config.rpcs.run_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.run_aggregation_query.timeout = 60.0 - default_config.rpcs.run_aggregation_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.begin_transaction.timeout = 60.0 - - default_config.rpcs.commit.timeout = 60.0 - - default_config.rpcs.rollback.timeout = 60.0 - - default_config.rpcs.allocate_ids.timeout = 60.0 - - default_config.rpcs.reserve_ids.timeout = 60.0 - default_config.rpcs.reserve_ids.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Datastore 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::Datastore::V1::Datastore::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 - @datastore_stub.universe_domain - end - - ## - # Create a new Datastore client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Datastore::V1::Datastore::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Datastore 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/datastore/v1/datastore_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 - - @datastore_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Datastore::V1::Datastore::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 - ) - end - - # Service calls - - ## - # Looks up entities by key. - # - # @overload lookup(request, options = nil) - # Pass arguments to `lookup` via a request object, either of type - # {::Google::Cloud::Datastore::V1::LookupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::V1::LookupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload lookup(project_id: nil, database_id: nil, read_options: nil, keys: nil, property_mask: nil) - # Pass arguments to `lookup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param read_options [::Google::Cloud::Datastore::V1::ReadOptions, ::Hash] - # The options for this lookup request. - # @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>] - # Required. Keys of entities to look up. - # @param property_mask [::Google::Cloud::Datastore::V1::PropertyMask, ::Hash] - # The properties to return. Defaults to returning all properties. - # - # If this field is set and an entity has a property not referenced in the - # mask, it will be absent from [LookupResponse.found.entity.properties][]. - # - # The entity's key is always returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Datastore::V1::LookupResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Datastore::V1::LookupResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::LookupRequest.new - # - # # Call the lookup method. - # result = client.lookup request - # - # # The returned object is of type Google::Cloud::Datastore::V1::LookupResponse. - # p result - # - def lookup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::V1::LookupRequest - - # Converts hash 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.lookup.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::Datastore::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.project_id && !request.project_id.empty? - header_params["project_id"] = request.project_id - end - if request.database_id && !request.database_id.empty? - header_params["database_id"] = request.database_id - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.lookup.timeout, - metadata: metadata, - retry_policy: @config.rpcs.lookup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @datastore_stub.call_rpc :lookup, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Queries for entities. - # - # @overload run_query(request, options = nil) - # Pass arguments to `run_query` via a request object, either of type - # {::Google::Cloud::Datastore::V1::RunQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, partition_id: nil, read_options: nil, query: nil, gql_query: nil, property_mask: 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 project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param partition_id [::Google::Cloud::Datastore::V1::PartitionId, ::Hash] - # Entities are partitioned into subsets, identified by a partition ID. - # Queries are scoped to a single partition. - # This partition ID is normalized with the standard default context - # partition ID. - # @param read_options [::Google::Cloud::Datastore::V1::ReadOptions, ::Hash] - # The options for this query. - # @param query [::Google::Cloud::Datastore::V1::Query, ::Hash] - # The query to run. - # @param gql_query [::Google::Cloud::Datastore::V1::GqlQuery, ::Hash] - # The GQL query to run. This query must be a non-aggregation query. - # @param property_mask [::Google::Cloud::Datastore::V1::PropertyMask, ::Hash] - # The properties to return. - # This field must not be set for a projection query. - # - # See - # {::Google::Cloud::Datastore::V1::LookupRequest#property_mask LookupRequest.property_mask}. - # @param explain_options [::Google::Cloud::Datastore::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 [::Google::Cloud::Datastore::V1::RunQueryResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Datastore::V1::RunQueryResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::RunQueryRequest.new - # - # # Call the run_query method. - # result = client.run_query request - # - # # The returned object is of type Google::Cloud::Datastore::V1::RunQueryResponse. - # p result - # - def run_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::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::Datastore::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.project_id && !request.project_id.empty? - header_params["project_id"] = request.project_id - end - if request.database_id && !request.database_id.empty? - header_params["database_id"] = request.database_id - end - - request_params_header = URI.encode_www_form header_params - 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 - - @datastore_stub.call_rpc :run_query, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Runs an aggregation query. - # - # @overload run_aggregation_query(request, options = nil) - # Pass arguments to `run_aggregation_query` via a request object, either of type - # {::Google::Cloud::Datastore::V1::RunAggregationQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, partition_id: nil, read_options: nil, aggregation_query: nil, gql_query: 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 project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param partition_id [::Google::Cloud::Datastore::V1::PartitionId, ::Hash] - # Entities are partitioned into subsets, identified by a partition ID. - # Queries are scoped to a single partition. - # This partition ID is normalized with the standard default context - # partition ID. - # @param read_options [::Google::Cloud::Datastore::V1::ReadOptions, ::Hash] - # The options for this query. - # @param aggregation_query [::Google::Cloud::Datastore::V1::AggregationQuery, ::Hash] - # The query to run. - # @param gql_query [::Google::Cloud::Datastore::V1::GqlQuery, ::Hash] - # The GQL query to run. This query must be an aggregation query. - # @param explain_options [::Google::Cloud::Datastore::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 [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new - # - # # Call the run_aggregation_query method. - # result = client.run_aggregation_query request - # - # # The returned object is of type Google::Cloud::Datastore::V1::RunAggregationQueryResponse. - # p result - # - def run_aggregation_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::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::Datastore::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.project_id && !request.project_id.empty? - header_params["project_id"] = request.project_id - end - if request.database_id && !request.database_id.empty? - header_params["database_id"] = request.database_id - end - - request_params_header = URI.encode_www_form header_params - 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 - - @datastore_stub.call_rpc :run_aggregation_query, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins a new transaction. - # - # @overload begin_transaction(request, options = nil) - # Pass arguments to `begin_transaction` via a request object, either of type - # {::Google::Cloud::Datastore::V1::BeginTransactionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, transaction_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 project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param transaction_options [::Google::Cloud::Datastore::V1::TransactionOptions, ::Hash] - # Options for a new transaction. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Datastore::V1::BeginTransactionResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Datastore::V1::BeginTransactionResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::BeginTransactionRequest.new - # - # # Call the begin_transaction method. - # result = client.begin_transaction request - # - # # The returned object is of type Google::Cloud::Datastore::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::Datastore::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::Datastore::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.project_id && !request.project_id.empty? - header_params["project_id"] = request.project_id - end - if request.database_id && !request.database_id.empty? - header_params["database_id"] = request.database_id - end - - request_params_header = URI.encode_www_form header_params - 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 - - @datastore_stub.call_rpc :begin_transaction, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Commits a transaction, optionally creating, deleting or modifying some - # entities. - # - # @overload commit(request, options = nil) - # Pass arguments to `commit` via a request object, either of type - # {::Google::Cloud::Datastore::V1::CommitRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, mode: nil, transaction: nil, single_use_transaction: nil, mutations: 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 project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param mode [::Google::Cloud::Datastore::V1::CommitRequest::Mode] - # The type of commit to perform. Defaults to `TRANSACTIONAL`. - # @param transaction [::String] - # The identifier of the transaction associated with the commit. A - # transaction identifier is returned by a call to - # {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}. - # @param single_use_transaction [::Google::Cloud::Datastore::V1::TransactionOptions, ::Hash] - # Options for beginning a new transaction for this request. - # The transaction is committed when the request completes. If specified, - # {::Google::Cloud::Datastore::V1::TransactionOptions TransactionOptions.mode} must be - # {::Google::Cloud::Datastore::V1::TransactionOptions::ReadWrite TransactionOptions.ReadWrite}. - # @param mutations [::Array<::Google::Cloud::Datastore::V1::Mutation, ::Hash>] - # The mutations to perform. - # - # When mode is `TRANSACTIONAL`, mutations affecting a single entity are - # applied in order. The following sequences of mutations affecting a single - # entity are not permitted in a single `Commit` request: - # - # - `insert` followed by `insert` - # - `update` followed by `insert` - # - `upsert` followed by `insert` - # - `delete` followed by `update` - # - # When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single - # entity. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Datastore::V1::CommitResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Datastore::V1::CommitResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::CommitRequest.new - # - # # Call the commit method. - # result = client.commit request - # - # # The returned object is of type Google::Cloud::Datastore::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::Datastore::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::Datastore::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.project_id && !request.project_id.empty? - header_params["project_id"] = request.project_id - end - if request.database_id && !request.database_id.empty? - header_params["database_id"] = request.database_id - end - - request_params_header = URI.encode_www_form header_params - 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 - - @datastore_stub.call_rpc :commit, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Rolls back a transaction. - # - # @overload rollback(request, options = nil) - # Pass arguments to `rollback` via a request object, either of type - # {::Google::Cloud::Datastore::V1::RollbackRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: 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 project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param transaction [::String] - # Required. The transaction identifier, returned by a call to - # {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Datastore::V1::RollbackResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Datastore::V1::RollbackResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::RollbackRequest.new - # - # # Call the rollback method. - # result = client.rollback request - # - # # The returned object is of type Google::Cloud::Datastore::V1::RollbackResponse. - # p result - # - def rollback request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::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::Datastore::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.project_id && !request.project_id.empty? - header_params["project_id"] = request.project_id - end - if request.database_id && !request.database_id.empty? - header_params["database_id"] = request.database_id - end - - request_params_header = URI.encode_www_form header_params - 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 - - @datastore_stub.call_rpc :rollback, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Allocates IDs for the given keys, which is useful for referencing an entity - # before it is inserted. - # - # @overload allocate_ids(request, options = nil) - # Pass arguments to `allocate_ids` via a request object, either of type - # {::Google::Cloud::Datastore::V1::AllocateIdsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::V1::AllocateIdsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload allocate_ids(project_id: nil, database_id: nil, keys: nil) - # Pass arguments to `allocate_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 project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>] - # Required. A list of keys with incomplete key paths for which to allocate - # IDs. No key may be reserved/read-only. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Datastore::V1::AllocateIdsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Datastore::V1::AllocateIdsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::AllocateIdsRequest.new - # - # # Call the allocate_ids method. - # result = client.allocate_ids request - # - # # The returned object is of type Google::Cloud::Datastore::V1::AllocateIdsResponse. - # p result - # - def allocate_ids request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::V1::AllocateIdsRequest - - # Converts hash 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.allocate_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::Datastore::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.project_id && !request.project_id.empty? - header_params["project_id"] = request.project_id - end - if request.database_id && !request.database_id.empty? - header_params["database_id"] = request.database_id - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.allocate_ids.timeout, - metadata: metadata, - retry_policy: @config.rpcs.allocate_ids.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @datastore_stub.call_rpc :allocate_ids, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Prevents the supplied keys' IDs from being auto-allocated by Cloud - # Datastore. - # - # @overload reserve_ids(request, options = nil) - # Pass arguments to `reserve_ids` via a request object, either of type - # {::Google::Cloud::Datastore::V1::ReserveIdsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::V1::ReserveIdsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload reserve_ids(project_id: nil, database_id: nil, keys: nil) - # Pass arguments to `reserve_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 project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>] - # Required. A list of keys with complete key paths whose numeric IDs should - # not be auto-allocated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Datastore::V1::ReserveIdsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Datastore::V1::ReserveIdsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::ReserveIdsRequest.new - # - # # Call the reserve_ids method. - # result = client.reserve_ids request - # - # # The returned object is of type Google::Cloud::Datastore::V1::ReserveIdsResponse. - # p result - # - def reserve_ids request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::V1::ReserveIdsRequest - - # Converts hash 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.reserve_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::Datastore::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.project_id && !request.project_id.empty? - header_params["project_id"] = request.project_id - end - if request.database_id && !request.database_id.empty? - header_params["database_id"] = request.database_id - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.reserve_ids.timeout, - metadata: metadata, - retry_policy: @config.rpcs.reserve_ids.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @datastore_stub.call_rpc :reserve_ids, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Datastore API. - # - # This class represents the configuration for Datastore, - # 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::Datastore::V1::Datastore::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 - # # lookup to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Datastore::V1::Datastore::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.lookup.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.lookup.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "datastore.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Datastore 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 `lookup` - # @return [::Gapic::Config::Method] - # - attr_reader :lookup - ## - # RPC-specific configuration for `run_query` - # @return [::Gapic::Config::Method] - # - attr_reader :run_query - ## - # RPC-specific configuration for `run_aggregation_query` - # @return [::Gapic::Config::Method] - # - attr_reader :run_aggregation_query - ## - # 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 `allocate_ids` - # @return [::Gapic::Config::Method] - # - attr_reader :allocate_ids - ## - # RPC-specific configuration for `reserve_ids` - # @return [::Gapic::Config::Method] - # - attr_reader :reserve_ids - - # @private - def initialize parent_rpcs = nil - lookup_config = parent_rpcs.lookup if parent_rpcs.respond_to? :lookup - @lookup = ::Gapic::Config::Method.new lookup_config - run_query_config = parent_rpcs.run_query if parent_rpcs.respond_to? :run_query - @run_query = ::Gapic::Config::Method.new run_query_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 - 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 - allocate_ids_config = parent_rpcs.allocate_ids if parent_rpcs.respond_to? :allocate_ids - @allocate_ids = ::Gapic::Config::Method.new allocate_ids_config - reserve_ids_config = parent_rpcs.reserve_ids if parent_rpcs.respond_to? :reserve_ids - @reserve_ids = ::Gapic::Config::Method.new reserve_ids_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/credentials.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/credentials.rb deleted file mode 100644 index 11b6c778cf7b..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Datastore - module V1 - module Datastore - # Credentials for the Datastore API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/datastore" - ] - self.env_vars = [ - "DATASTORE_CREDENTIALS", - "DATASTORE_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DATASTORE_CREDENTIALS_JSON", - "DATASTORE_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-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest.rb deleted file mode 100644 index 9ddabd458851..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/datastore/v1/version" - -require "google/cloud/datastore/v1/datastore/credentials" -require "google/cloud/datastore/v1/datastore/rest/client" - -module Google - module Cloud - module Datastore - module V1 - ## - # Each RPC normalizes the partition IDs of the keys in its input entities, - # and always returns entities with keys with normalized partition IDs. - # This applies to all keys and entities, including those in values, except keys - # with both an empty path and an empty or unset partition ID. Normalization of - # input keys sets the project ID (if not already set) to the project ID from - # the request. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/datastore/v1/datastore/rest" - # client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new - # - module Datastore - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/datastore/v1/datastore/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/client.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/client.rb deleted file mode 100644 index 6d753e2815f5..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/client.rb +++ /dev/null @@ -1,1149 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/datastore/v1/datastore_pb" -require "google/cloud/datastore/v1/datastore/rest/service_stub" - -module Google - module Cloud - module Datastore - module V1 - module Datastore - module Rest - ## - # REST client for the Datastore service. - # - # Each RPC normalizes the partition IDs of the keys in its input entities, - # and always returns entities with keys with normalized partition IDs. - # This applies to all keys and entities, including those in values, except keys - # with both an empty path and an empty or unset partition ID. Normalization of - # input keys sets the project ID (if not already set) to the project ID from - # the request. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "datastore.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :datastore_stub - - ## - # Configure the Datastore Client class. - # - # See {::Google::Cloud::Datastore::V1::Datastore::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Datastore clients - # ::Google::Cloud::Datastore::V1::Datastore::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", "Datastore", "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.lookup.timeout = 60.0 - default_config.rpcs.lookup.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.run_query.timeout = 60.0 - default_config.rpcs.run_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.run_aggregation_query.timeout = 60.0 - default_config.rpcs.run_aggregation_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.begin_transaction.timeout = 60.0 - - default_config.rpcs.commit.timeout = 60.0 - - default_config.rpcs.rollback.timeout = 60.0 - - default_config.rpcs.allocate_ids.timeout = 60.0 - - default_config.rpcs.reserve_ids.timeout = 60.0 - default_config.rpcs.reserve_ids.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Datastore 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::Datastore::V1::Datastore::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 - @datastore_stub.universe_domain - end - - ## - # Create a new Datastore REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Datastore 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 - - @datastore_stub = ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - end - - # Service calls - - ## - # Looks up entities by key. - # - # @overload lookup(request, options = nil) - # Pass arguments to `lookup` via a request object, either of type - # {::Google::Cloud::Datastore::V1::LookupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::V1::LookupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload lookup(project_id: nil, database_id: nil, read_options: nil, keys: nil, property_mask: nil) - # Pass arguments to `lookup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param read_options [::Google::Cloud::Datastore::V1::ReadOptions, ::Hash] - # The options for this lookup request. - # @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>] - # Required. Keys of entities to look up. - # @param property_mask [::Google::Cloud::Datastore::V1::PropertyMask, ::Hash] - # The properties to return. Defaults to returning all properties. - # - # If this field is set and an entity has a property not referenced in the - # mask, it will be absent from [LookupResponse.found.entity.properties][]. - # - # The entity's key is always returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Datastore::V1::LookupResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::V1::LookupResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::LookupRequest.new - # - # # Call the lookup method. - # result = client.lookup request - # - # # The returned object is of type Google::Cloud::Datastore::V1::LookupResponse. - # p result - # - def lookup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::V1::LookupRequest - - # Converts hash 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.lookup.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::Datastore::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.lookup.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.lookup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @datastore_stub.lookup request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Queries for entities. - # - # @overload run_query(request, options = nil) - # Pass arguments to `run_query` via a request object, either of type - # {::Google::Cloud::Datastore::V1::RunQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, partition_id: nil, read_options: nil, query: nil, gql_query: nil, property_mask: 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 project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param partition_id [::Google::Cloud::Datastore::V1::PartitionId, ::Hash] - # Entities are partitioned into subsets, identified by a partition ID. - # Queries are scoped to a single partition. - # This partition ID is normalized with the standard default context - # partition ID. - # @param read_options [::Google::Cloud::Datastore::V1::ReadOptions, ::Hash] - # The options for this query. - # @param query [::Google::Cloud::Datastore::V1::Query, ::Hash] - # The query to run. - # @param gql_query [::Google::Cloud::Datastore::V1::GqlQuery, ::Hash] - # The GQL query to run. This query must be a non-aggregation query. - # @param property_mask [::Google::Cloud::Datastore::V1::PropertyMask, ::Hash] - # The properties to return. - # This field must not be set for a projection query. - # - # See - # {::Google::Cloud::Datastore::V1::LookupRequest#property_mask LookupRequest.property_mask}. - # @param explain_options [::Google::Cloud::Datastore::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 [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Datastore::V1::RunQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::V1::RunQueryResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::RunQueryRequest.new - # - # # Call the run_query method. - # result = client.run_query request - # - # # The returned object is of type Google::Cloud::Datastore::V1::RunQueryResponse. - # p result - # - def run_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::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::Datastore::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 - - @datastore_stub.run_query request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Runs an aggregation query. - # - # @overload run_aggregation_query(request, options = nil) - # Pass arguments to `run_aggregation_query` via a request object, either of type - # {::Google::Cloud::Datastore::V1::RunAggregationQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, partition_id: nil, read_options: nil, aggregation_query: nil, gql_query: 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 project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param partition_id [::Google::Cloud::Datastore::V1::PartitionId, ::Hash] - # Entities are partitioned into subsets, identified by a partition ID. - # Queries are scoped to a single partition. - # This partition ID is normalized with the standard default context - # partition ID. - # @param read_options [::Google::Cloud::Datastore::V1::ReadOptions, ::Hash] - # The options for this query. - # @param aggregation_query [::Google::Cloud::Datastore::V1::AggregationQuery, ::Hash] - # The query to run. - # @param gql_query [::Google::Cloud::Datastore::V1::GqlQuery, ::Hash] - # The GQL query to run. This query must be an aggregation query. - # @param explain_options [::Google::Cloud::Datastore::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 [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new - # - # # Call the run_aggregation_query method. - # result = client.run_aggregation_query request - # - # # The returned object is of type Google::Cloud::Datastore::V1::RunAggregationQueryResponse. - # p result - # - def run_aggregation_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::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::Datastore::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 - - @datastore_stub.run_aggregation_query request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins a new transaction. - # - # @overload begin_transaction(request, options = nil) - # Pass arguments to `begin_transaction` via a request object, either of type - # {::Google::Cloud::Datastore::V1::BeginTransactionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, transaction_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 project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param transaction_options [::Google::Cloud::Datastore::V1::TransactionOptions, ::Hash] - # Options for a new transaction. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Datastore::V1::BeginTransactionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::V1::BeginTransactionResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::BeginTransactionRequest.new - # - # # Call the begin_transaction method. - # result = client.begin_transaction request - # - # # The returned object is of type Google::Cloud::Datastore::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::Datastore::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::Datastore::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 - - @datastore_stub.begin_transaction request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Commits a transaction, optionally creating, deleting or modifying some - # entities. - # - # @overload commit(request, options = nil) - # Pass arguments to `commit` via a request object, either of type - # {::Google::Cloud::Datastore::V1::CommitRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: nil, mode: nil, transaction: nil, single_use_transaction: nil, mutations: 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 project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param mode [::Google::Cloud::Datastore::V1::CommitRequest::Mode] - # The type of commit to perform. Defaults to `TRANSACTIONAL`. - # @param transaction [::String] - # The identifier of the transaction associated with the commit. A - # transaction identifier is returned by a call to - # {::Google::Cloud::Datastore::V1::Datastore::Rest::Client#begin_transaction Datastore.BeginTransaction}. - # @param single_use_transaction [::Google::Cloud::Datastore::V1::TransactionOptions, ::Hash] - # Options for beginning a new transaction for this request. - # The transaction is committed when the request completes. If specified, - # {::Google::Cloud::Datastore::V1::TransactionOptions TransactionOptions.mode} must be - # {::Google::Cloud::Datastore::V1::TransactionOptions::ReadWrite TransactionOptions.ReadWrite}. - # @param mutations [::Array<::Google::Cloud::Datastore::V1::Mutation, ::Hash>] - # The mutations to perform. - # - # When mode is `TRANSACTIONAL`, mutations affecting a single entity are - # applied in order. The following sequences of mutations affecting a single - # entity are not permitted in a single `Commit` request: - # - # - `insert` followed by `insert` - # - `update` followed by `insert` - # - `upsert` followed by `insert` - # - `delete` followed by `update` - # - # When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single - # entity. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Datastore::V1::CommitResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::V1::CommitResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::CommitRequest.new - # - # # Call the commit method. - # result = client.commit request - # - # # The returned object is of type Google::Cloud::Datastore::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::Datastore::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::Datastore::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 - - @datastore_stub.commit request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Rolls back a transaction. - # - # @overload rollback(request, options = nil) - # Pass arguments to `rollback` via a request object, either of type - # {::Google::Cloud::Datastore::V1::RollbackRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::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(project_id: nil, database_id: 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 project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param transaction [::String] - # Required. The transaction identifier, returned by a call to - # {::Google::Cloud::Datastore::V1::Datastore::Rest::Client#begin_transaction Datastore.BeginTransaction}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Datastore::V1::RollbackResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::V1::RollbackResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::RollbackRequest.new - # - # # Call the rollback method. - # result = client.rollback request - # - # # The returned object is of type Google::Cloud::Datastore::V1::RollbackResponse. - # p result - # - def rollback request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::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::Datastore::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 - - @datastore_stub.rollback request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Allocates IDs for the given keys, which is useful for referencing an entity - # before it is inserted. - # - # @overload allocate_ids(request, options = nil) - # Pass arguments to `allocate_ids` via a request object, either of type - # {::Google::Cloud::Datastore::V1::AllocateIdsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::V1::AllocateIdsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload allocate_ids(project_id: nil, database_id: nil, keys: nil) - # Pass arguments to `allocate_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 project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>] - # Required. A list of keys with incomplete key paths for which to allocate - # IDs. No key may be reserved/read-only. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Datastore::V1::AllocateIdsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::V1::AllocateIdsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::AllocateIdsRequest.new - # - # # Call the allocate_ids method. - # result = client.allocate_ids request - # - # # The returned object is of type Google::Cloud::Datastore::V1::AllocateIdsResponse. - # p result - # - def allocate_ids request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::V1::AllocateIdsRequest - - # Converts hash 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.allocate_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::Datastore::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.allocate_ids.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.allocate_ids.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @datastore_stub.allocate_ids request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Prevents the supplied keys' IDs from being auto-allocated by Cloud - # Datastore. - # - # @overload reserve_ids(request, options = nil) - # Pass arguments to `reserve_ids` via a request object, either of type - # {::Google::Cloud::Datastore::V1::ReserveIdsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Datastore::V1::ReserveIdsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload reserve_ids(project_id: nil, database_id: nil, keys: nil) - # Pass arguments to `reserve_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 project_id [::String] - # Required. The ID of the project against which to make the request. - # @param database_id [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>] - # Required. A list of keys with complete key paths whose numeric IDs should - # not be auto-allocated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Datastore::V1::ReserveIdsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::V1::ReserveIdsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/datastore/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Datastore::V1::ReserveIdsRequest.new - # - # # Call the reserve_ids method. - # result = client.reserve_ids request - # - # # The returned object is of type Google::Cloud::Datastore::V1::ReserveIdsResponse. - # p result - # - def reserve_ids request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::V1::ReserveIdsRequest - - # Converts hash 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.reserve_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::Datastore::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.reserve_ids.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.reserve_ids.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @datastore_stub.reserve_ids request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Datastore REST API. - # - # This class represents the configuration for Datastore 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::Datastore::V1::Datastore::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 - # # lookup to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.lookup.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.lookup.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "datastore.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Datastore 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 `lookup` - # @return [::Gapic::Config::Method] - # - attr_reader :lookup - ## - # RPC-specific configuration for `run_query` - # @return [::Gapic::Config::Method] - # - attr_reader :run_query - ## - # RPC-specific configuration for `run_aggregation_query` - # @return [::Gapic::Config::Method] - # - attr_reader :run_aggregation_query - ## - # 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 `allocate_ids` - # @return [::Gapic::Config::Method] - # - attr_reader :allocate_ids - ## - # RPC-specific configuration for `reserve_ids` - # @return [::Gapic::Config::Method] - # - attr_reader :reserve_ids - - # @private - def initialize parent_rpcs = nil - lookup_config = parent_rpcs.lookup if parent_rpcs.respond_to? :lookup - @lookup = ::Gapic::Config::Method.new lookup_config - run_query_config = parent_rpcs.run_query if parent_rpcs.respond_to? :run_query - @run_query = ::Gapic::Config::Method.new run_query_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 - 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 - allocate_ids_config = parent_rpcs.allocate_ids if parent_rpcs.respond_to? :allocate_ids - @allocate_ids = ::Gapic::Config::Method.new allocate_ids_config - reserve_ids_config = parent_rpcs.reserve_ids if parent_rpcs.respond_to? :reserve_ids - @reserve_ids = ::Gapic::Config::Method.new reserve_ids_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/service_stub.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/service_stub.rb deleted file mode 100644 index 3c0106796b80..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/service_stub.rb +++ /dev/null @@ -1,549 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/datastore/v1/datastore_pb" - -module Google - module Cloud - module Datastore - module V1 - module Datastore - module Rest - ## - # REST service stub for the Datastore service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # Baseline implementation for the lookup REST call - # - # @param request_pb [::Google::Cloud::Datastore::V1::LookupRequest] - # 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::Datastore::V1::LookupResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::V1::LookupResponse] - # A result object deserialized from the server's reply - def lookup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_lookup_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Datastore::V1::LookupResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the run_query REST call - # - # @param request_pb [::Google::Cloud::Datastore::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. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Datastore::V1::RunQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::V1::RunQueryResponse] - # A result object deserialized from the server's reply - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Datastore::V1::RunQueryResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the run_aggregation_query REST call - # - # @param request_pb [::Google::Cloud::Datastore::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. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse] - # A result object deserialized from the server's reply - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Datastore::V1::RunAggregationQueryResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the begin_transaction REST call - # - # @param request_pb [::Google::Cloud::Datastore::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::Datastore::V1::BeginTransactionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Datastore::V1::BeginTransactionResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the commit REST call - # - # @param request_pb [::Google::Cloud::Datastore::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::Datastore::V1::CommitResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Datastore::V1::CommitResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the rollback REST call - # - # @param request_pb [::Google::Cloud::Datastore::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::Cloud::Datastore::V1::RollbackResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::V1::RollbackResponse] - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Datastore::V1::RollbackResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the allocate_ids REST call - # - # @param request_pb [::Google::Cloud::Datastore::V1::AllocateIdsRequest] - # 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::Datastore::V1::AllocateIdsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::V1::AllocateIdsResponse] - # A result object deserialized from the server's reply - def allocate_ids request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_allocate_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Datastore::V1::AllocateIdsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the reserve_ids REST call - # - # @param request_pb [::Google::Cloud::Datastore::V1::ReserveIdsRequest] - # 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::Datastore::V1::ReserveIdsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Datastore::V1::ReserveIdsResponse] - # A result object deserialized from the server's reply - def reserve_ids request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_reserve_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Datastore::V1::ReserveIdsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the lookup REST call - # - # @param request_pb [::Google::Cloud::Datastore::V1::LookupRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_lookup_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/projects/{project_id}:lookup", - body: "*", - matches: [ - ["project_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_query REST call - # - # @param request_pb [::Google::Cloud::Datastore::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/projects/{project_id}:runQuery", - body: "*", - matches: [ - ["project_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_aggregation_query REST call - # - # @param request_pb [::Google::Cloud::Datastore::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/projects/{project_id}:runAggregationQuery", - body: "*", - matches: [ - ["project_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the begin_transaction REST call - # - # @param request_pb [::Google::Cloud::Datastore::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/projects/{project_id}:beginTransaction", - body: "*", - matches: [ - ["project_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the commit REST call - # - # @param request_pb [::Google::Cloud::Datastore::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/projects/{project_id}:commit", - body: "*", - matches: [ - ["project_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the rollback REST call - # - # @param request_pb [::Google::Cloud::Datastore::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/projects/{project_id}:rollback", - body: "*", - matches: [ - ["project_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the allocate_ids REST call - # - # @param request_pb [::Google::Cloud::Datastore::V1::AllocateIdsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_allocate_ids_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/projects/{project_id}:allocateIds", - body: "*", - matches: [ - ["project_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the reserve_ids REST call - # - # @param request_pb [::Google::Cloud::Datastore::V1::ReserveIdsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_reserve_ids_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/projects/{project_id}:reserveIds", - body: "*", - matches: [ - ["project_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/rest.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/rest.rb deleted file mode 100644 index 59b837e1a537..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/rest.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/datastore/v1/datastore/rest" -require "google/cloud/datastore/v1/version" - -module Google - module Cloud - module Datastore - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/datastore/v1/rest" - # client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/version.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/version.rb deleted file mode 100644 index 66fdb773219e..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Datastore - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/aggregation_result_pb.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/aggregation_result_pb.rb deleted file mode 100644 index fdcef6dd2696..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/aggregation_result_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/datastore/v1/aggregation_result.proto - -require 'google/protobuf' - -require 'google/datastore/v1/entity_pb' -require 'google/datastore/v1/query_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n,google/datastore/v1/aggregation_result.proto\x12\x13google.datastore.v1\x1a google/datastore/v1/entity.proto\x1a\x1fgoogle/datastore/v1/query.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xca\x01\n\x11\x41ggregationResult\x12]\n\x14\x61ggregate_properties\x18\x02 \x03(\x0b\x32?.google.datastore.v1.AggregationResult.AggregatePropertiesEntry\x1aV\n\x18\x41ggregatePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.datastore.v1.Value:\x02\x38\x01\"\xd9\x01\n\x16\x41ggregationResultBatch\x12\x43\n\x13\x61ggregation_results\x18\x01 \x03(\x0b\x32&.google.datastore.v1.AggregationResult\x12K\n\x0cmore_results\x18\x02 \x01(\x0e\x32\x35.google.datastore.v1.QueryResultBatch.MoreResultsType\x12-\n\tread_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xc7\x01\n\x17\x63om.google.datastore.v1B\x16\x41ggregationResultProtoP\x01Z;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb\xaa\x02\x19Google.Cloud.Datastore.V1\xca\x02\x19Google\\Cloud\\Datastore\\V1\xea\x02\x1cGoogle::Cloud::Datastore::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.datastore.v1.Value", "google/datastore/v1/entity.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Datastore - module V1 - AggregationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationResult").msgclass - AggregationResultBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationResultBatch").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_pb.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_pb.rb deleted file mode 100644 index 6d65402143eb..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_pb.rb +++ /dev/null @@ -1,84 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/datastore/v1/datastore.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/datastore/v1/aggregation_result_pb' -require 'google/datastore/v1/entity_pb' -require 'google/datastore/v1/query_pb' -require 'google/datastore/v1/query_profile_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n#google/datastore/v1/datastore.proto\x12\x13google.datastore.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x18google/api/routing.proto\x1a,google/datastore/v1/aggregation_result.proto\x1a google/datastore/v1/entity.proto\x1a\x1fgoogle/datastore/v1/query.proto\x1a\'google/datastore/v1/query_profile.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdc\x01\n\rLookupRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x36\n\x0cread_options\x18\x01 \x01(\x0b\x32 .google.datastore.v1.ReadOptions\x12+\n\x04keys\x18\x03 \x03(\x0b\x32\x18.google.datastore.v1.KeyB\x03\xe0\x41\x02\x12\x38\n\rproperty_mask\x18\x05 \x01(\x0b\x32!.google.datastore.v1.PropertyMask\"\xe6\x01\n\x0eLookupResponse\x12\x30\n\x05\x66ound\x18\x01 \x03(\x0b\x32!.google.datastore.v1.EntityResult\x12\x32\n\x07missing\x18\x02 \x03(\x0b\x32!.google.datastore.v1.EntityResult\x12*\n\x08\x64\x65\x66\x65rred\x18\x03 \x03(\x0b\x32\x18.google.datastore.v1.Key\x12\x13\n\x0btransaction\x18\x05 \x01(\x0c\x12-\n\tread_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x9b\x03\n\x0fRunQueryRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x36\n\x0cpartition_id\x18\x02 \x01(\x0b\x32 .google.datastore.v1.PartitionId\x12\x36\n\x0cread_options\x18\x01 \x01(\x0b\x32 .google.datastore.v1.ReadOptions\x12+\n\x05query\x18\x03 \x01(\x0b\x32\x1a.google.datastore.v1.QueryH\x00\x12\x32\n\tgql_query\x18\x07 \x01(\x0b\x32\x1d.google.datastore.v1.GqlQueryH\x00\x12\x38\n\rproperty_mask\x18\n \x01(\x0b\x32!.google.datastore.v1.PropertyMask\x12\x41\n\x0f\x65xplain_options\x18\x0c \x01(\x0b\x32#.google.datastore.v1.ExplainOptionsB\x03\xe0\x41\x01\x42\x0c\n\nquery_type\"\xc6\x01\n\x10RunQueryResponse\x12\x34\n\x05\x62\x61tch\x18\x01 \x01(\x0b\x32%.google.datastore.v1.QueryResultBatch\x12)\n\x05query\x18\x02 \x01(\x0b\x32\x1a.google.datastore.v1.Query\x12\x13\n\x0btransaction\x18\x05 \x01(\x0c\x12<\n\x0f\x65xplain_metrics\x18\t \x01(\x0b\x32#.google.datastore.v1.ExplainMetrics\"\x83\x03\n\x1aRunAggregationQueryRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x36\n\x0cpartition_id\x18\x02 \x01(\x0b\x32 .google.datastore.v1.PartitionId\x12\x36\n\x0cread_options\x18\x01 \x01(\x0b\x32 .google.datastore.v1.ReadOptions\x12\x42\n\x11\x61ggregation_query\x18\x03 \x01(\x0b\x32%.google.datastore.v1.AggregationQueryH\x00\x12\x32\n\tgql_query\x18\x07 \x01(\x0b\x32\x1d.google.datastore.v1.GqlQueryH\x00\x12\x41\n\x0f\x65xplain_options\x18\x0b \x01(\x0b\x32#.google.datastore.v1.ExplainOptionsB\x03\xe0\x41\x01\x42\x0c\n\nquery_type\"\xe2\x01\n\x1bRunAggregationQueryResponse\x12:\n\x05\x62\x61tch\x18\x01 \x01(\x0b\x32+.google.datastore.v1.AggregationResultBatch\x12\x34\n\x05query\x18\x02 \x01(\x0b\x32%.google.datastore.v1.AggregationQuery\x12\x13\n\x0btransaction\x18\x05 \x01(\x0c\x12<\n\x0f\x65xplain_metrics\x18\t \x01(\x0b\x32#.google.datastore.v1.ExplainMetrics\"\x8d\x01\n\x17\x42\x65ginTransactionRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x44\n\x13transaction_options\x18\n \x01(\x0b\x32\'.google.datastore.v1.TransactionOptions\"/\n\x18\x42\x65ginTransactionResponse\x12\x13\n\x0btransaction\x18\x01 \x01(\x0c\"Y\n\x0fRollbackRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x18\n\x0btransaction\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\"\x12\n\x10RollbackResponse\"\xe8\x02\n\rCommitRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12\x35\n\x04mode\x18\x05 \x01(\x0e\x32\'.google.datastore.v1.CommitRequest.Mode\x12\x15\n\x0btransaction\x18\x01 \x01(\x0cH\x00\x12I\n\x16single_use_transaction\x18\n \x01(\x0b\x32\'.google.datastore.v1.TransactionOptionsH\x00\x12\x30\n\tmutations\x18\x06 \x03(\x0b\x32\x1d.google.datastore.v1.Mutation\"F\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x11\n\rTRANSACTIONAL\x10\x01\x12\x15\n\x11NON_TRANSACTIONAL\x10\x02\x42\x16\n\x14transaction_selector\"\x97\x01\n\x0e\x43ommitResponse\x12=\n\x10mutation_results\x18\x03 \x03(\x0b\x32#.google.datastore.v1.MutationResult\x12\x15\n\rindex_updates\x18\x04 \x01(\x05\x12/\n\x0b\x63ommit_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"o\n\x12\x41llocateIdsRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12+\n\x04keys\x18\x01 \x03(\x0b\x32\x18.google.datastore.v1.KeyB\x03\xe0\x41\x02\"=\n\x13\x41llocateIdsResponse\x12&\n\x04keys\x18\x01 \x03(\x0b\x32\x18.google.datastore.v1.Key\"n\n\x11ReserveIdsRequest\x12\x17\n\nproject_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61tabase_id\x18\t \x01(\t\x12+\n\x04keys\x18\x01 \x03(\x0b\x32\x18.google.datastore.v1.KeyB\x03\xe0\x41\x02\"\x14\n\x12ReserveIdsResponse\"\xf2\x04\n\x08Mutation\x12-\n\x06insert\x18\x04 \x01(\x0b\x32\x1b.google.datastore.v1.EntityH\x00\x12-\n\x06update\x18\x05 \x01(\x0b\x32\x1b.google.datastore.v1.EntityH\x00\x12-\n\x06upsert\x18\x06 \x01(\x0b\x32\x1b.google.datastore.v1.EntityH\x00\x12*\n\x06\x64\x65lete\x18\x07 \x01(\x0b\x32\x18.google.datastore.v1.KeyH\x00\x12\x16\n\x0c\x62\x61se_version\x18\x08 \x01(\x03H\x01\x12\x31\n\x0bupdate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12^\n\x1c\x63onflict_resolution_strategy\x18\n \x01(\x0e\x32\x38.google.datastore.v1.Mutation.ConflictResolutionStrategy\x12\x38\n\rproperty_mask\x18\t \x01(\x0b\x32!.google.datastore.v1.PropertyMask\x12H\n\x13property_transforms\x18\x0c \x03(\x0b\x32&.google.datastore.v1.PropertyTransformB\x03\xe0\x41\x01\"R\n\x1a\x43onflictResolutionStrategy\x12\x18\n\x14STRATEGY_UNSPECIFIED\x10\x00\x12\x10\n\x0cSERVER_VALUE\x10\x01\x12\x08\n\x04\x46\x41IL\x10\x03\x42\x0b\n\toperationB\x1d\n\x1b\x63onflict_detection_strategy\"\xe3\x03\n\x11PropertyTransform\x12\x15\n\x08property\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12Q\n\x13set_to_server_value\x18\x02 \x01(\x0e\x32\x32.google.datastore.v1.PropertyTransform.ServerValueH\x00\x12/\n\tincrement\x18\x03 \x01(\x0b\x32\x1a.google.datastore.v1.ValueH\x00\x12-\n\x07maximum\x18\x04 \x01(\x0b\x32\x1a.google.datastore.v1.ValueH\x00\x12-\n\x07minimum\x18\x05 \x01(\x0b\x32\x1a.google.datastore.v1.ValueH\x00\x12\x42\n\x17\x61ppend_missing_elements\x18\x06 \x01(\x0b\x32\x1f.google.datastore.v1.ArrayValueH\x00\x12@\n\x15remove_all_from_array\x18\x07 \x01(\x0b\x32\x1f.google.datastore.v1.ArrayValueH\x00\"=\n\x0bServerValue\x12\x1c\n\x18SERVER_VALUE_UNSPECIFIED\x10\x00\x12\x10\n\x0cREQUEST_TIME\x10\x01\x42\x10\n\x0etransform_type\"\xfc\x01\n\x0eMutationResult\x12%\n\x03key\x18\x03 \x01(\x0b\x32\x18.google.datastore.v1.Key\x12\x0f\n\x07version\x18\x04 \x01(\x03\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x19\n\x11\x63onflict_detected\x18\x05 \x01(\x08\x12\x35\n\x11transform_results\x18\x08 \x03(\x0b\x32\x1a.google.datastore.v1.Value\"\x1d\n\x0cPropertyMask\x12\r\n\x05paths\x18\x01 \x03(\t\"\xca\x02\n\x0bReadOptions\x12L\n\x10read_consistency\x18\x01 \x01(\x0e\x32\x30.google.datastore.v1.ReadOptions.ReadConsistencyH\x00\x12\x15\n\x0btransaction\x18\x02 \x01(\x0cH\x00\x12\x42\n\x0fnew_transaction\x18\x03 \x01(\x0b\x32\'.google.datastore.v1.TransactionOptionsH\x00\x12/\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\"M\n\x0fReadConsistency\x12 \n\x1cREAD_CONSISTENCY_UNSPECIFIED\x10\x00\x12\n\n\x06STRONG\x10\x01\x12\x0c\n\x08\x45VENTUAL\x10\x02\x42\x12\n\x10\x63onsistency_type\"\x92\x02\n\x12TransactionOptions\x12G\n\nread_write\x18\x01 \x01(\x0b\x32\x31.google.datastore.v1.TransactionOptions.ReadWriteH\x00\x12\x45\n\tread_only\x18\x02 \x01(\x0b\x32\x30.google.datastore.v1.TransactionOptions.ReadOnlyH\x00\x1a)\n\tReadWrite\x12\x1c\n\x14previous_transaction\x18\x01 \x01(\x0c\x1a\x39\n\x08ReadOnly\x12-\n\tread_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\n\x04mode2\xe1\r\n\tDatastore\x12\xc0\x01\n\x06Lookup\x12\".google.datastore.v1.LookupRequest\x1a#.google.datastore.v1.LookupResponse\"m\xda\x41\x1cproject_id,read_options,keys\x82\xd3\xe4\x93\x02%\" /v1/projects/{project_id}:lookup:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xa9\x01\n\x08RunQuery\x12$.google.datastore.v1.RunQueryRequest\x1a%.google.datastore.v1.RunQueryResponse\"P\x82\xd3\xe4\x93\x02\'\"\"/v1/projects/{project_id}:runQuery:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xd5\x01\n\x13RunAggregationQuery\x12/.google.datastore.v1.RunAggregationQueryRequest\x1a\x30.google.datastore.v1.RunAggregationQueryResponse\"[\x82\xd3\xe4\x93\x02\x32\"-/v1/projects/{project_id}:runAggregationQuery:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xd6\x01\n\x10\x42\x65ginTransaction\x12,.google.datastore.v1.BeginTransactionRequest\x1a-.google.datastore.v1.BeginTransactionResponse\"e\xda\x41\nproject_id\x82\xd3\xe4\x93\x02/\"*/v1/projects/{project_id}:beginTransaction:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xe6\x01\n\x06\x43ommit\x12\".google.datastore.v1.CommitRequest\x1a#.google.datastore.v1.CommitResponse\"\x92\x01\xda\x41%project_id,mode,transaction,mutations\xda\x41\x19project_id,mode,mutations\x82\xd3\xe4\x93\x02%\" /v1/projects/{project_id}:commit:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xc2\x01\n\x08Rollback\x12$.google.datastore.v1.RollbackRequest\x1a%.google.datastore.v1.RollbackResponse\"i\xda\x41\x16project_id,transaction\x82\xd3\xe4\x93\x02\'\"\"/v1/projects/{project_id}:rollback:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xc7\x01\n\x0b\x41llocateIds\x12\'.google.datastore.v1.AllocateIdsRequest\x1a(.google.datastore.v1.AllocateIdsResponse\"e\xda\x41\x0fproject_id,keys\x82\xd3\xe4\x93\x02*\"%/v1/projects/{project_id}:allocateIds:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x12\xc3\x01\n\nReserveIds\x12&.google.datastore.v1.ReserveIdsRequest\x1a\'.google.datastore.v1.ReserveIdsResponse\"d\xda\x41\x0fproject_id,keys\x82\xd3\xe4\x93\x02)\"$/v1/projects/{project_id}:reserveIds:\x01*\x8a\xd3\xe4\x93\x02\x1d\x12\x0c\n\nproject_id\x12\r\n\x0b\x64\x61tabase_id\x1av\xca\x41\x18\x64\x61tastore.googleapis.com\xd2\x41Xhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastoreB\xbf\x01\n\x17\x63om.google.datastore.v1B\x0e\x44\x61tastoreProtoP\x01Z;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb\xaa\x02\x19Google.Cloud.Datastore.V1\xca\x02\x19Google\\Cloud\\Datastore\\V1\xea\x02\x1cGoogle::Cloud::Datastore::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.datastore.v1.Key", "google/datastore/v1/entity.proto"], - ["google.datastore.v1.EntityResult", "google/datastore/v1/query.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.datastore.v1.ExplainOptions", "google/datastore/v1/query_profile.proto"], - ["google.datastore.v1.AggregationResultBatch", "google/datastore/v1/aggregation_result.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 Datastore - module V1 - LookupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.LookupRequest").msgclass - LookupResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.LookupResponse").msgclass - RunQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunQueryRequest").msgclass - RunQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunQueryResponse").msgclass - RunAggregationQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunAggregationQueryRequest").msgclass - RunAggregationQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunAggregationQueryResponse").msgclass - BeginTransactionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.BeginTransactionRequest").msgclass - BeginTransactionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.BeginTransactionResponse").msgclass - RollbackRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RollbackRequest").msgclass - RollbackResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RollbackResponse").msgclass - CommitRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.CommitRequest").msgclass - CommitRequest::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.CommitRequest.Mode").enummodule - CommitResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.CommitResponse").msgclass - AllocateIdsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AllocateIdsRequest").msgclass - AllocateIdsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AllocateIdsResponse").msgclass - ReserveIdsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ReserveIdsRequest").msgclass - ReserveIdsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ReserveIdsResponse").msgclass - Mutation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Mutation").msgclass - Mutation::ConflictResolutionStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Mutation.ConflictResolutionStrategy").enummodule - PropertyTransform = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyTransform").msgclass - PropertyTransform::ServerValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyTransform.ServerValue").enummodule - MutationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.MutationResult").msgclass - PropertyMask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyMask").msgclass - ReadOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ReadOptions").msgclass - ReadOptions::ReadConsistency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ReadOptions.ReadConsistency").enummodule - TransactionOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.TransactionOptions").msgclass - TransactionOptions::ReadWrite = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.TransactionOptions.ReadWrite").msgclass - TransactionOptions::ReadOnly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.TransactionOptions.ReadOnly").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_services_pb.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_services_pb.rb deleted file mode 100644 index f53f2cd7b06c..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/datastore_services_pb.rb +++ /dev/null @@ -1,68 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/datastore/v1/datastore.proto for package 'Google.Cloud.Datastore.V1' -# Original file comments: -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/datastore/v1/datastore_pb' - -module Google - module Cloud - module Datastore - module V1 - module Datastore - # Each RPC normalizes the partition IDs of the keys in its input entities, - # and always returns entities with keys with normalized partition IDs. - # This applies to all keys and entities, including those in values, except keys - # with both an empty path and an empty or unset partition ID. Normalization of - # input keys sets the project ID (if not already set) to the project ID from - # the request. - # - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.datastore.v1.Datastore' - - # Looks up entities by key. - rpc :Lookup, ::Google::Cloud::Datastore::V1::LookupRequest, ::Google::Cloud::Datastore::V1::LookupResponse - # Queries for entities. - rpc :RunQuery, ::Google::Cloud::Datastore::V1::RunQueryRequest, ::Google::Cloud::Datastore::V1::RunQueryResponse - # Runs an aggregation query. - rpc :RunAggregationQuery, ::Google::Cloud::Datastore::V1::RunAggregationQueryRequest, ::Google::Cloud::Datastore::V1::RunAggregationQueryResponse - # Begins a new transaction. - rpc :BeginTransaction, ::Google::Cloud::Datastore::V1::BeginTransactionRequest, ::Google::Cloud::Datastore::V1::BeginTransactionResponse - # Commits a transaction, optionally creating, deleting or modifying some - # entities. - rpc :Commit, ::Google::Cloud::Datastore::V1::CommitRequest, ::Google::Cloud::Datastore::V1::CommitResponse - # Rolls back a transaction. - rpc :Rollback, ::Google::Cloud::Datastore::V1::RollbackRequest, ::Google::Cloud::Datastore::V1::RollbackResponse - # Allocates IDs for the given keys, which is useful for referencing an entity - # before it is inserted. - rpc :AllocateIds, ::Google::Cloud::Datastore::V1::AllocateIdsRequest, ::Google::Cloud::Datastore::V1::AllocateIdsResponse - # Prevents the supplied keys' IDs from being auto-allocated by Cloud - # Datastore. - rpc :ReserveIds, ::Google::Cloud::Datastore::V1::ReserveIdsRequest, ::Google::Cloud::Datastore::V1::ReserveIdsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/entity_pb.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/entity_pb.rb deleted file mode 100644 index a80ab75a63e4..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/entity_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/datastore/v1/entity.proto - -require 'google/protobuf' - -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' -require 'google/type/latlng_pb' - - -descriptor_data = "\n google/datastore/v1/entity.proto\x12\x13google.datastore.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x18google/type/latlng.proto\"L\n\x0bPartitionId\x12\x12\n\nproject_id\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x61tabase_id\x18\x03 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x04 \x01(\t\"\xb7\x01\n\x03Key\x12\x36\n\x0cpartition_id\x18\x01 \x01(\x0b\x32 .google.datastore.v1.PartitionId\x12\x32\n\x04path\x18\x02 \x03(\x0b\x32$.google.datastore.v1.Key.PathElement\x1a\x44\n\x0bPathElement\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0c\n\x02id\x18\x02 \x01(\x03H\x00\x12\x0e\n\x04name\x18\x03 \x01(\tH\x00\x42\t\n\x07id_type\"8\n\nArrayValue\x12*\n\x06values\x18\x01 \x03(\x0b\x32\x1a.google.datastore.v1.Value\"\xf1\x03\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-\n\tkey_value\x18\x05 \x01(\x0b\x32\x18.google.datastore.v1.KeyH\x00\x12\x16\n\x0cstring_value\x18\x11 \x01(\tH\x00\x12\x14\n\nblob_value\x18\x12 \x01(\x0cH\x00\x12.\n\x0fgeo_point_value\x18\x08 \x01(\x0b\x32\x13.google.type.LatLngH\x00\x12\x33\n\x0c\x65ntity_value\x18\x06 \x01(\x0b\x32\x1b.google.datastore.v1.EntityH\x00\x12\x36\n\x0b\x61rray_value\x18\t \x01(\x0b\x32\x1f.google.datastore.v1.ArrayValueH\x00\x12\x0f\n\x07meaning\x18\x0e \x01(\x05\x12\x1c\n\x14\x65xclude_from_indexes\x18\x13 \x01(\x08\x42\x0c\n\nvalue_type\"\xbf\x01\n\x06\x45ntity\x12%\n\x03key\x18\x01 \x01(\x0b\x32\x18.google.datastore.v1.Key\x12?\n\nproperties\x18\x03 \x03(\x0b\x32+.google.datastore.v1.Entity.PropertiesEntry\x1aM\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.datastore.v1.Value:\x02\x38\x01\x42\xbc\x01\n\x17\x63om.google.datastore.v1B\x0b\x45ntityProtoP\x01Z;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb\xaa\x02\x19Google.Cloud.Datastore.V1\xca\x02\x19Google\\Cloud\\Datastore\\V1\xea\x02\x1cGoogle::Cloud::Datastore::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 Datastore - module V1 - PartitionId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PartitionId").msgclass - Key = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Key").msgclass - Key::PathElement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Key.PathElement").msgclass - ArrayValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ArrayValue").msgclass - Value = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Value").msgclass - Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Entity").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_pb.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_pb.rb deleted file mode 100644 index 3d0015501530..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_pb.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/datastore/v1/query.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/datastore/v1/entity_pb' -require 'google/protobuf/timestamp_pb' -require 'google/protobuf/wrappers_pb' - - -descriptor_data = "\n\x1fgoogle/datastore/v1/query.proto\x12\x13google.datastore.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a google/datastore/v1/entity.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\x91\x02\n\x0c\x45ntityResult\x12+\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x1b.google.datastore.v1.Entity\x12\x0f\n\x07version\x18\x04 \x01(\x03\x12/\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0e\n\x06\x63ursor\x18\x03 \x01(\x0c\"Q\n\nResultType\x12\x1b\n\x17RESULT_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x46ULL\x10\x01\x12\x0e\n\nPROJECTION\x10\x02\x12\x0c\n\x08KEY_ONLY\x10\x03\"\xf2\x02\n\x05Query\x12\x33\n\nprojection\x18\x02 \x03(\x0b\x32\x1f.google.datastore.v1.Projection\x12\x31\n\x04kind\x18\x03 \x03(\x0b\x32#.google.datastore.v1.KindExpression\x12+\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x1b.google.datastore.v1.Filter\x12\x31\n\x05order\x18\x05 \x03(\x0b\x32\".google.datastore.v1.PropertyOrder\x12;\n\x0b\x64istinct_on\x18\x06 \x03(\x0b\x32&.google.datastore.v1.PropertyReference\x12\x14\n\x0cstart_cursor\x18\x07 \x01(\x0c\x12\x12\n\nend_cursor\x18\x08 \x01(\x0c\x12\x0e\n\x06offset\x18\n \x01(\x05\x12*\n\x05limit\x18\x0c \x01(\x0b\x32\x1b.google.protobuf.Int32Value\"\xe4\x04\n\x10\x41ggregationQuery\x12\x32\n\x0cnested_query\x18\x01 \x01(\x0b\x32\x1a.google.datastore.v1.QueryH\x00\x12L\n\x0c\x61ggregations\x18\x03 \x03(\x0b\x32\x31.google.datastore.v1.AggregationQuery.AggregationB\x03\xe0\x41\x01\x1a\xbf\x03\n\x0b\x41ggregation\x12H\n\x05\x63ount\x18\x01 \x01(\x0b\x32\x37.google.datastore.v1.AggregationQuery.Aggregation.CountH\x00\x12\x44\n\x03sum\x18\x02 \x01(\x0b\x32\x35.google.datastore.v1.AggregationQuery.Aggregation.SumH\x00\x12\x44\n\x03\x61vg\x18\x03 \x01(\x0b\x32\x35.google.datastore.v1.AggregationQuery.Aggregation.AvgH\x00\x12\x12\n\x05\x61lias\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\x38\n\x05\x43ount\x12/\n\x05up_to\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xe0\x41\x01\x1a?\n\x03Sum\x12\x38\n\x08property\x18\x01 \x01(\x0b\x32&.google.datastore.v1.PropertyReference\x1a?\n\x03\x41vg\x12\x38\n\x08property\x18\x01 \x01(\x0b\x32&.google.datastore.v1.PropertyReferenceB\n\n\x08operatorB\x0c\n\nquery_type\"\x1e\n\x0eKindExpression\x12\x0c\n\x04name\x18\x01 \x01(\t\"!\n\x11PropertyReference\x12\x0c\n\x04name\x18\x02 \x01(\t\"F\n\nProjection\x12\x38\n\x08property\x18\x01 \x01(\x0b\x32&.google.datastore.v1.PropertyReference\"\xd1\x01\n\rPropertyOrder\x12\x38\n\x08property\x18\x01 \x01(\x0b\x32&.google.datastore.v1.PropertyReference\x12?\n\tdirection\x18\x02 \x01(\x0e\x32,.google.datastore.v1.PropertyOrder.Direction\"E\n\tDirection\x12\x19\n\x15\x44IRECTION_UNSPECIFIED\x10\x00\x12\r\n\tASCENDING\x10\x01\x12\x0e\n\nDESCENDING\x10\x02\"\x99\x01\n\x06\x46ilter\x12@\n\x10\x63omposite_filter\x18\x01 \x01(\x0b\x32$.google.datastore.v1.CompositeFilterH\x00\x12>\n\x0fproperty_filter\x18\x02 \x01(\x0b\x32#.google.datastore.v1.PropertyFilterH\x00\x42\r\n\x0b\x66ilter_type\"\xb1\x01\n\x0f\x43ompositeFilter\x12\x39\n\x02op\x18\x01 \x01(\x0e\x32-.google.datastore.v1.CompositeFilter.Operator\x12,\n\x07\x66ilters\x18\x02 \x03(\x0b\x32\x1b.google.datastore.v1.Filter\"5\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41ND\x10\x01\x12\x06\n\x02OR\x10\x02\"\xea\x02\n\x0ePropertyFilter\x12\x38\n\x08property\x18\x01 \x01(\x0b\x32&.google.datastore.v1.PropertyReference\x12\x38\n\x02op\x18\x02 \x01(\x0e\x32,.google.datastore.v1.PropertyFilter.Operator\x12)\n\x05value\x18\x03 \x01(\x0b\x32\x1a.google.datastore.v1.Value\"\xb8\x01\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\r\n\tLESS_THAN\x10\x01\x12\x16\n\x12LESS_THAN_OR_EQUAL\x10\x02\x12\x10\n\x0cGREATER_THAN\x10\x03\x12\x19\n\x15GREATER_THAN_OR_EQUAL\x10\x04\x12\t\n\x05\x45QUAL\x10\x05\x12\x06\n\x02IN\x10\x06\x12\r\n\tNOT_EQUAL\x10\t\x12\x10\n\x0cHAS_ANCESTOR\x10\x0b\x12\n\n\x06NOT_IN\x10\r\"\xa5\x02\n\x08GqlQuery\x12\x14\n\x0cquery_string\x18\x01 \x01(\t\x12\x16\n\x0e\x61llow_literals\x18\x02 \x01(\x08\x12H\n\x0enamed_bindings\x18\x05 \x03(\x0b\x32\x30.google.datastore.v1.GqlQuery.NamedBindingsEntry\x12\x43\n\x13positional_bindings\x18\x04 \x03(\x0b\x32&.google.datastore.v1.GqlQueryParameter\x1a\\\n\x12NamedBindingsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32&.google.datastore.v1.GqlQueryParameter:\x02\x38\x01\"d\n\x11GqlQueryParameter\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.datastore.v1.ValueH\x00\x12\x10\n\x06\x63ursor\x18\x03 \x01(\x0cH\x00\x42\x10\n\x0eparameter_type\"\x8d\x04\n\x10QueryResultBatch\x12\x17\n\x0fskipped_results\x18\x06 \x01(\x05\x12\x16\n\x0eskipped_cursor\x18\x03 \x01(\x0c\x12H\n\x12\x65ntity_result_type\x18\x01 \x01(\x0e\x32,.google.datastore.v1.EntityResult.ResultType\x12\x39\n\x0e\x65ntity_results\x18\x02 \x03(\x0b\x32!.google.datastore.v1.EntityResult\x12\x12\n\nend_cursor\x18\x04 \x01(\x0c\x12K\n\x0cmore_results\x18\x05 \x01(\x0e\x32\x35.google.datastore.v1.QueryResultBatch.MoreResultsType\x12\x18\n\x10snapshot_version\x18\x07 \x01(\x03\x12-\n\tread_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x98\x01\n\x0fMoreResultsType\x12!\n\x1dMORE_RESULTS_TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cNOT_FINISHED\x10\x01\x12\x1c\n\x18MORE_RESULTS_AFTER_LIMIT\x10\x02\x12\x1d\n\x19MORE_RESULTS_AFTER_CURSOR\x10\x04\x12\x13\n\x0fNO_MORE_RESULTS\x10\x03\x42\xbb\x01\n\x17\x63om.google.datastore.v1B\nQueryProtoP\x01Z;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb\xaa\x02\x19Google.Cloud.Datastore.V1\xca\x02\x19Google\\Cloud\\Datastore\\V1\xea\x02\x1cGoogle::Cloud::Datastore::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.datastore.v1.Entity", "google/datastore/v1/entity.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.Int32Value", "google/protobuf/wrappers.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 Datastore - module V1 - EntityResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.EntityResult").msgclass - EntityResult::ResultType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.EntityResult.ResultType").enummodule - Query = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Query").msgclass - AggregationQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationQuery").msgclass - AggregationQuery::Aggregation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationQuery.Aggregation").msgclass - AggregationQuery::Aggregation::Count = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationQuery.Aggregation.Count").msgclass - AggregationQuery::Aggregation::Sum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationQuery.Aggregation.Sum").msgclass - AggregationQuery::Aggregation::Avg = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationQuery.Aggregation.Avg").msgclass - KindExpression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.KindExpression").msgclass - PropertyReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyReference").msgclass - Projection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Projection").msgclass - PropertyOrder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyOrder").msgclass - PropertyOrder::Direction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyOrder.Direction").enummodule - Filter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Filter").msgclass - CompositeFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.CompositeFilter").msgclass - CompositeFilter::Operator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.CompositeFilter.Operator").enummodule - PropertyFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyFilter").msgclass - PropertyFilter::Operator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyFilter.Operator").enummodule - GqlQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.GqlQuery").msgclass - GqlQueryParameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.GqlQueryParameter").msgclass - QueryResultBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.QueryResultBatch").msgclass - QueryResultBatch::MoreResultsType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.QueryResultBatch.MoreResultsType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_profile_pb.rb b/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_profile_pb.rb deleted file mode 100644 index 573a5bd2c0b4..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/lib/google/datastore/v1/query_profile_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/datastore/v1/query_profile.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n\'google/datastore/v1/query_profile.proto\x12\x13google.datastore.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\"&\n\x0e\x45xplainOptions\x12\x14\n\x07\x61nalyze\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"\x86\x01\n\x0e\x45xplainMetrics\x12\x36\n\x0cplan_summary\x18\x01 \x01(\x0b\x32 .google.datastore.v1.PlanSummary\x12<\n\x0f\x65xecution_stats\x18\x02 \x01(\x0b\x32#.google.datastore.v1.ExecutionStats\"<\n\x0bPlanSummary\x12-\n\x0cindexes_used\x18\x01 \x03(\x0b\x32\x17.google.protobuf.Struct\"\xa8\x01\n\x0e\x45xecutionStats\x12\x18\n\x10results_returned\x18\x01 \x01(\x03\x12\x35\n\x12\x65xecution_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x17\n\x0fread_operations\x18\x04 \x01(\x03\x12,\n\x0b\x64\x65\x62ug_stats\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructB\xc2\x01\n\x17\x63om.google.datastore.v1B\x11QueryProfileProtoP\x01Z;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb\xaa\x02\x19Google.Cloud.Datastore.V1\xca\x02\x19Google\\Cloud\\Datastore\\V1\xea\x02\x1cGoogle::Cloud::Datastore::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Struct", "google/protobuf/struct.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Datastore - module V1 - ExplainOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ExplainOptions").msgclass - ExplainMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ExplainMetrics").msgclass - PlanSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PlanSummary").msgclass - ExecutionStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.ExecutionStats").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/README.md deleted file mode 100644 index 10c788a336b5..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Firestore in Datastore mode V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 2223d8935069..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,420 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!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. - 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. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # 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 - - # 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-datastore-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index b03587481349..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 38b4b61e6061..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 935946d52792..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. 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-datastore-v1/proto_docs/google/api/routing.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/routing.rb deleted file mode 100644 index 53c8874ea19d..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/api/routing.rb +++ /dev/null @@ -1,459 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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`. - # In the examples below I am skipping the percent-encoding for readablity. - # - # 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-datastore-v1/proto_docs/google/datastore/v1/aggregation_result.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/aggregation_result.rb deleted file mode 100644 index 7224fe9fd4a6..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/aggregation_result.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Datastore - module V1 - # The result of a single bucket from a Datastore aggregation query. - # - # The keys of `aggregate_properties` are the same for all results in an - # aggregation query, unlike entity queries which can have different fields - # present for each result. - # @!attribute [rw] aggregate_properties - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Datastore::V1::Value}] - # The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. - # - # The key is the - # {::Google::Cloud::Datastore::V1::AggregationQuery::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::Datastore::V1::Value] - class AggregatePropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A batch of aggregation results produced by an aggregation query. - # @!attribute [rw] aggregation_results - # @return [::Array<::Google::Cloud::Datastore::V1::AggregationResult>] - # The aggregation results for this batch. - # @!attribute [rw] more_results - # @return [::Google::Cloud::Datastore::V1::QueryResultBatch::MoreResultsType] - # The state of the query after the current batch. - # Only COUNT(*) aggregations are supported in the initial launch. Therefore, - # expected result type is limited to `NO_MORE_RESULTS`. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Read timestamp this batch was returned from. - # - # In a single transaction, subsequent query result batches for the same query - # can have a greater timestamp. Each batch's read timestamp - # is valid for all preceding batches. - class AggregationResultBatch - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/datastore.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/datastore.rb deleted file mode 100644 index c9d762c8f17c..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/datastore.rb +++ /dev/null @@ -1,709 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Datastore - module V1 - # The request for {::Google::Cloud::Datastore::V1::Datastore::Client#lookup Datastore.Lookup}. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the project against which to make the request. - # @!attribute [rw] database_id - # @return [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @!attribute [rw] read_options - # @return [::Google::Cloud::Datastore::V1::ReadOptions] - # The options for this lookup request. - # @!attribute [rw] keys - # @return [::Array<::Google::Cloud::Datastore::V1::Key>] - # Required. Keys of entities to look up. - # @!attribute [rw] property_mask - # @return [::Google::Cloud::Datastore::V1::PropertyMask] - # The properties to return. Defaults to returning all properties. - # - # If this field is set and an entity has a property not referenced in the - # mask, it will be absent from [LookupResponse.found.entity.properties][]. - # - # The entity's key is always returned. - class LookupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for {::Google::Cloud::Datastore::V1::Datastore::Client#lookup Datastore.Lookup}. - # @!attribute [rw] found - # @return [::Array<::Google::Cloud::Datastore::V1::EntityResult>] - # Entities found as `ResultType.FULL` entities. The order of results in this - # field is undefined and has no relation to the order of the keys in the - # input. - # @!attribute [rw] missing - # @return [::Array<::Google::Cloud::Datastore::V1::EntityResult>] - # Entities not found as `ResultType.KEY_ONLY` entities. The order of results - # in this field is undefined and has no relation to the order of the keys - # in the input. - # @!attribute [rw] deferred - # @return [::Array<::Google::Cloud::Datastore::V1::Key>] - # A list of keys that were not looked up due to resource constraints. The - # order of results in this field is undefined and has no relation to the - # order of the keys in the input. - # @!attribute [rw] transaction - # @return [::String] - # The identifier of the transaction that was started as part of this Lookup - # request. - # - # Set only when - # {::Google::Cloud::Datastore::V1::ReadOptions#new_transaction ReadOptions.new_transaction} - # was set in - # {::Google::Cloud::Datastore::V1::LookupRequest#read_options LookupRequest.read_options}. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # The time at which these entities were read or found missing. - class LookupResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Datastore::V1::Datastore::Client#run_query Datastore.RunQuery}. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the project against which to make the request. - # @!attribute [rw] database_id - # @return [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @!attribute [rw] partition_id - # @return [::Google::Cloud::Datastore::V1::PartitionId] - # Entities are partitioned into subsets, identified by a partition ID. - # Queries are scoped to a single partition. - # This partition ID is normalized with the standard default context - # partition ID. - # @!attribute [rw] read_options - # @return [::Google::Cloud::Datastore::V1::ReadOptions] - # The options for this query. - # @!attribute [rw] query - # @return [::Google::Cloud::Datastore::V1::Query] - # The query to run. - # @!attribute [rw] gql_query - # @return [::Google::Cloud::Datastore::V1::GqlQuery] - # The GQL query to run. This query must be a non-aggregation query. - # @!attribute [rw] property_mask - # @return [::Google::Cloud::Datastore::V1::PropertyMask] - # The properties to return. - # This field must not be set for a projection query. - # - # See - # {::Google::Cloud::Datastore::V1::LookupRequest#property_mask LookupRequest.property_mask}. - # @!attribute [rw] explain_options - # @return [::Google::Cloud::Datastore::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::Datastore::V1::Datastore::Client#run_query Datastore.RunQuery}. - # @!attribute [rw] batch - # @return [::Google::Cloud::Datastore::V1::QueryResultBatch] - # A batch of query results (always present). - # @!attribute [rw] query - # @return [::Google::Cloud::Datastore::V1::Query] - # The parsed form of the `GqlQuery` from the request, if it was set. - # @!attribute [rw] transaction - # @return [::String] - # The identifier of the transaction that was started as part of this - # RunQuery request. - # - # Set only when - # {::Google::Cloud::Datastore::V1::ReadOptions#new_transaction ReadOptions.new_transaction} - # was set in - # {::Google::Cloud::Datastore::V1::RunQueryRequest#read_options RunQueryRequest.read_options}. - # @!attribute [rw] explain_metrics - # @return [::Google::Cloud::Datastore::V1::ExplainMetrics] - # Query explain metrics. This is only present when the - # {::Google::Cloud::Datastore::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::Datastore::V1::Datastore::Client#run_aggregation_query Datastore.RunAggregationQuery}. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the project against which to make the request. - # @!attribute [rw] database_id - # @return [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @!attribute [rw] partition_id - # @return [::Google::Cloud::Datastore::V1::PartitionId] - # Entities are partitioned into subsets, identified by a partition ID. - # Queries are scoped to a single partition. - # This partition ID is normalized with the standard default context - # partition ID. - # @!attribute [rw] read_options - # @return [::Google::Cloud::Datastore::V1::ReadOptions] - # The options for this query. - # @!attribute [rw] aggregation_query - # @return [::Google::Cloud::Datastore::V1::AggregationQuery] - # The query to run. - # @!attribute [rw] gql_query - # @return [::Google::Cloud::Datastore::V1::GqlQuery] - # The GQL query to run. This query must be an aggregation query. - # @!attribute [rw] explain_options - # @return [::Google::Cloud::Datastore::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::Datastore::V1::Datastore::Client#run_aggregation_query Datastore.RunAggregationQuery}. - # @!attribute [rw] batch - # @return [::Google::Cloud::Datastore::V1::AggregationResultBatch] - # A batch of aggregation results. Always present. - # @!attribute [rw] query - # @return [::Google::Cloud::Datastore::V1::AggregationQuery] - # The parsed form of the `GqlQuery` from the request, if it was set. - # @!attribute [rw] transaction - # @return [::String] - # The identifier of the transaction that was started as part of this - # RunAggregationQuery request. - # - # Set only when - # {::Google::Cloud::Datastore::V1::ReadOptions#new_transaction ReadOptions.new_transaction} - # was set in - # {::Google::Cloud::Datastore::V1::RunAggregationQueryRequest#read_options RunAggregationQueryRequest.read_options}. - # @!attribute [rw] explain_metrics - # @return [::Google::Cloud::Datastore::V1::ExplainMetrics] - # Query explain metrics. This is only present when the - # {::Google::Cloud::Datastore::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::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the project against which to make the request. - # @!attribute [rw] database_id - # @return [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @!attribute [rw] transaction_options - # @return [::Google::Cloud::Datastore::V1::TransactionOptions] - # Options for a new transaction. - class BeginTransactionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}. - # @!attribute [rw] transaction - # @return [::String] - # The transaction identifier (always present). - class BeginTransactionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Datastore::V1::Datastore::Client#rollback Datastore.Rollback}. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the project against which to make the request. - # @!attribute [rw] database_id - # @return [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @!attribute [rw] transaction - # @return [::String] - # Required. The transaction identifier, returned by a call to - # {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}. - class RollbackRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Datastore::V1::Datastore::Client#rollback Datastore.Rollback}. (an empty - # message). - class RollbackResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for {::Google::Cloud::Datastore::V1::Datastore::Client#commit Datastore.Commit}. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the project against which to make the request. - # @!attribute [rw] database_id - # @return [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @!attribute [rw] mode - # @return [::Google::Cloud::Datastore::V1::CommitRequest::Mode] - # The type of commit to perform. Defaults to `TRANSACTIONAL`. - # @!attribute [rw] transaction - # @return [::String] - # The identifier of the transaction associated with the commit. A - # transaction identifier is returned by a call to - # {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}. - # @!attribute [rw] single_use_transaction - # @return [::Google::Cloud::Datastore::V1::TransactionOptions] - # Options for beginning a new transaction for this request. - # The transaction is committed when the request completes. If specified, - # {::Google::Cloud::Datastore::V1::TransactionOptions TransactionOptions.mode} must be - # {::Google::Cloud::Datastore::V1::TransactionOptions::ReadWrite TransactionOptions.ReadWrite}. - # @!attribute [rw] mutations - # @return [::Array<::Google::Cloud::Datastore::V1::Mutation>] - # The mutations to perform. - # - # When mode is `TRANSACTIONAL`, mutations affecting a single entity are - # applied in order. The following sequences of mutations affecting a single - # entity are not permitted in a single `Commit` request: - # - # - `insert` followed by `insert` - # - `update` followed by `insert` - # - `upsert` followed by `insert` - # - `delete` followed by `update` - # - # When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single - # entity. - class CommitRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The modes available for commits. - module Mode - # Unspecified. This value must not be used. - MODE_UNSPECIFIED = 0 - - # Transactional: The mutations are either all applied, or none are applied. - # Learn about transactions - # [here](https://cloud.google.com/datastore/docs/concepts/transactions). - TRANSACTIONAL = 1 - - # Non-transactional: The mutations may not apply as all or none. - NON_TRANSACTIONAL = 2 - end - end - - # The response for {::Google::Cloud::Datastore::V1::Datastore::Client#commit Datastore.Commit}. - # @!attribute [rw] mutation_results - # @return [::Array<::Google::Cloud::Datastore::V1::MutationResult>] - # The result of performing the mutations. - # The i-th mutation result corresponds to the i-th mutation in the request. - # @!attribute [rw] index_updates - # @return [::Integer] - # The number of index entries updated during the commit, or zero if none were - # updated. - # @!attribute [rw] commit_time - # @return [::Google::Protobuf::Timestamp] - # The transaction commit timestamp. Not set for non-transactional commits. - class CommitResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Datastore::V1::Datastore::Client#allocate_ids Datastore.AllocateIds}. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the project against which to make the request. - # @!attribute [rw] database_id - # @return [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @!attribute [rw] keys - # @return [::Array<::Google::Cloud::Datastore::V1::Key>] - # Required. A list of keys with incomplete key paths for which to allocate - # IDs. No key may be reserved/read-only. - class AllocateIdsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Datastore::V1::Datastore::Client#allocate_ids Datastore.AllocateIds}. - # @!attribute [rw] keys - # @return [::Array<::Google::Cloud::Datastore::V1::Key>] - # The keys specified in the request (in the same order), each with - # its key path completed with a newly allocated ID. - class AllocateIdsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Datastore::V1::Datastore::Client#reserve_ids Datastore.ReserveIds}. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the project against which to make the request. - # @!attribute [rw] database_id - # @return [::String] - # The ID of the database against which to make the request. - # - # '(default)' is not allowed; please use empty string '' to refer the default - # database. - # @!attribute [rw] keys - # @return [::Array<::Google::Cloud::Datastore::V1::Key>] - # Required. A list of keys with complete key paths whose numeric IDs should - # not be auto-allocated. - class ReserveIdsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Datastore::V1::Datastore::Client#reserve_ids Datastore.ReserveIds}. - class ReserveIdsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A mutation to apply to an entity. - # @!attribute [rw] insert - # @return [::Google::Cloud::Datastore::V1::Entity] - # The entity to insert. The entity must not already exist. - # The entity key's final path element may be incomplete. - # @!attribute [rw] update - # @return [::Google::Cloud::Datastore::V1::Entity] - # The entity to update. The entity must already exist. - # Must have a complete key path. - # @!attribute [rw] upsert - # @return [::Google::Cloud::Datastore::V1::Entity] - # The entity to upsert. The entity may or may not already exist. - # The entity key's final path element may be incomplete. - # @!attribute [rw] delete - # @return [::Google::Cloud::Datastore::V1::Key] - # The key of the entity to delete. The entity may or may not already exist. - # Must have a complete key path and must not be reserved/read-only. - # @!attribute [rw] base_version - # @return [::Integer] - # The version of the entity that this mutation is being applied - # to. If this does not match the current version on the server, the - # mutation conflicts. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The update time of the entity that this mutation is being applied - # to. If this does not match the current update time on the server, the - # mutation conflicts. - # @!attribute [rw] conflict_resolution_strategy - # @return [::Google::Cloud::Datastore::V1::Mutation::ConflictResolutionStrategy] - # The strategy to use when a conflict is detected. Defaults to - # `SERVER_VALUE`. - # If this is set, then `conflict_detection_strategy` must also be set. - # @!attribute [rw] property_mask - # @return [::Google::Cloud::Datastore::V1::PropertyMask] - # The properties to write in this mutation. - # None of the properties in the mask may have a reserved name, except for - # `__key__`. - # This field is ignored for `delete`. - # - # If the entity already exists, only properties referenced in the mask are - # updated, others are left untouched. - # Properties referenced in the mask but not in the entity are deleted. - # @!attribute [rw] property_transforms - # @return [::Array<::Google::Cloud::Datastore::V1::PropertyTransform>] - # Optional. The transforms to perform on the entity. - # - # This field can be set only when the operation is `insert`, `update`, - # or `upsert`. If present, the transforms are be applied to the entity - # regardless of the property mask, in order, after the operation. - class Mutation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The possible ways to resolve a conflict detected in a mutation. - module ConflictResolutionStrategy - # Unspecified. Defaults to `SERVER_VALUE`. - STRATEGY_UNSPECIFIED = 0 - - # The server entity is kept. - SERVER_VALUE = 1 - - # The whole commit request fails. - FAIL = 3 - end - end - - # A transformation of an entity property. - # @!attribute [rw] property - # @return [::String] - # Optional. The name of the property. - # - # Property paths (a list of property names separated by dots (`.`)) may be - # used to refer to properties inside entity values. For example `foo.bar` - # means the property `bar` inside the entity property `foo`. - # - # If a property name contains a dot `.` or a backlslash `\`, then that name - # must be escaped. - # @!attribute [rw] set_to_server_value - # @return [::Google::Cloud::Datastore::V1::PropertyTransform::ServerValue] - # Sets the property to the given server value. - # @!attribute [rw] increment - # @return [::Google::Cloud::Datastore::V1::Value] - # Adds the given value to the property's current value. - # - # This must be an integer or a double value. - # If the property is not an integer or double, or if the property does not - # yet exist, the transformation will set the property to the given value. - # If either of the given value or the current property value are doubles, - # both values will be interpreted as doubles. Double arithmetic and - # representation of double values follows IEEE 754 semantics. - # If there is positive/negative integer overflow, the property is resolved - # to the largest magnitude positive/negative integer. - # @!attribute [rw] maximum - # @return [::Google::Cloud::Datastore::V1::Value] - # Sets the property to the maximum of its current value and the given - # value. - # - # This must be an integer or a double value. - # If the property is not an integer or double, or if the property does not - # yet exist, the transformation will set the property to the given value. - # If a maximum operation is applied where the property and the input value - # are of mixed types (that is - one is an integer and one is a double) - # the property takes on the type of the larger operand. If the operands are - # equivalent (e.g. 3 and 3.0), the property 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. - # @!attribute [rw] minimum - # @return [::Google::Cloud::Datastore::V1::Value] - # Sets the property to the minimum of its current value and the given - # value. - # - # This must be an integer or a double value. - # If the property is not an integer or double, or if the property does not - # yet exist, the transformation will set the property to the input value. - # If a minimum operation is applied where the property and the input value - # are of mixed types (that is - one is an integer and one is a double) - # the property takes on the type of the smaller operand. If the operands - # are equivalent (e.g. 3 and 3.0), the property 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. - # @!attribute [rw] append_missing_elements - # @return [::Google::Cloud::Datastore::V1::ArrayValue] - # Appends the given elements in order if they are not already present in - # the current property value. - # If the property is not an array, or if the property 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 the null value is equal to the null value. - # If the input contains multiple equivalent values, only the first will - # be considered. - # - # The corresponding transform result will be the null value. - # @!attribute [rw] remove_all_from_array - # @return [::Google::Cloud::Datastore::V1::ArrayValue] - # Removes all of the given elements from the array in the property. - # If the property is not an array, or if the property does not yet exist, - # it is set to the empty array. - # - # Equivalent numbers of 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 the null value is equal to the null value. - # This will remove all equivalent values if there are duplicates. - # - # The corresponding transform result will be the null value. - class PropertyTransform - 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 properties (same or different entities) - # in a transaction, all the properties will get the same server timestamp. - REQUEST_TIME = 1 - end - end - - # The result of applying a mutation. - # @!attribute [rw] key - # @return [::Google::Cloud::Datastore::V1::Key] - # The automatically allocated key. - # Set only when the mutation allocated a key. - # @!attribute [rw] version - # @return [::Integer] - # The version of the entity on the server after processing the mutation. If - # the mutation doesn't change anything on the server, then the version will - # be the version of the current entity or, if no entity is present, a version - # that is strictly greater than the version of any previous entity and less - # than the version of any possible future entity. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The create time of the entity. This field will not be set after a 'delete'. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The update time of the entity on the server after processing the mutation. - # If the mutation doesn't change anything on the server, then the timestamp - # will be the update timestamp of the current entity. This field will not be - # set after a 'delete'. - # @!attribute [rw] conflict_detected - # @return [::Boolean] - # Whether a conflict was detected for this mutation. Always false when a - # conflict detection strategy field is not set in the mutation. - # @!attribute [rw] transform_results - # @return [::Array<::Google::Cloud::Datastore::V1::Value>] - # The results of applying each - # {::Google::Cloud::Datastore::V1::PropertyTransform PropertyTransform}, in the same - # order of the request. - class MutationResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The set of arbitrarily nested property paths used to restrict an operation to - # only a subset of properties in an entity. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The paths to the properties covered by this mask. - # - # A path is a list of property names separated by dots (`.`), for example - # `foo.bar` means the property `bar` inside the entity property `foo` inside - # the entity associated with this path. - # - # If a property name contains a dot `.` or a backslash `\`, then that - # name must be escaped. - # - # A path must not be empty, and may not reference a value inside an - # {::Google::Cloud::Datastore::V1::Value#array_value array value}. - class PropertyMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The options shared by read requests. - # @!attribute [rw] read_consistency - # @return [::Google::Cloud::Datastore::V1::ReadOptions::ReadConsistency] - # The non-transactional read consistency to use. - # @!attribute [rw] transaction - # @return [::String] - # The identifier of the transaction in which to read. A - # transaction identifier is returned by a call to - # {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}. - # @!attribute [rw] new_transaction - # @return [::Google::Cloud::Datastore::V1::TransactionOptions] - # Options for beginning a new transaction for this request. - # - # The new transaction identifier will be returned in the corresponding - # response as either - # {::Google::Cloud::Datastore::V1::LookupResponse#transaction LookupResponse.transaction} - # or - # {::Google::Cloud::Datastore::V1::RunQueryResponse#transaction RunQueryResponse.transaction}. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Reads entities as they were at the given time. This value is only - # supported for Cloud Firestore in Datastore mode. - # - # 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 ReadOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The possible values for read consistencies. - module ReadConsistency - # Unspecified. This value must not be used. - READ_CONSISTENCY_UNSPECIFIED = 0 - - # Strong consistency. - STRONG = 1 - - # Eventual consistency. - EVENTUAL = 2 - end - end - - # Options for beginning a new transaction. - # - # Transactions can be created explicitly with calls to - # {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction} - # or implicitly by setting - # {::Google::Cloud::Datastore::V1::ReadOptions#new_transaction ReadOptions.new_transaction} - # in read requests. - # @!attribute [rw] read_write - # @return [::Google::Cloud::Datastore::V1::TransactionOptions::ReadWrite] - # The transaction should allow both reads and writes. - # @!attribute [rw] read_only - # @return [::Google::Cloud::Datastore::V1::TransactionOptions::ReadOnly] - # The transaction should only allow reads. - class TransactionOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Options specific to read / write transactions. - # @!attribute [rw] previous_transaction - # @return [::String] - # The transaction identifier of the transaction being retried. - class ReadWrite - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options specific to read-only transactions. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Reads entities 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-datastore-v1/proto_docs/google/datastore/v1/entity.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/entity.rb deleted file mode 100644 index aecd57bcf4d2..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/entity.rb +++ /dev/null @@ -1,235 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Datastore - module V1 - # A partition ID identifies a grouping of entities. The grouping is always - # by project and namespace, however the namespace ID may be empty. - # - # A partition ID contains several dimensions: - # project ID and namespace ID. - # - # Partition dimensions: - # - # - May be `""`. - # - Must be valid UTF-8 bytes. - # - Must have values that match regex `[A-Za-z\d\.\-_]{1,100}` - # If the value of any dimension matches regex `__.*__`, the partition is - # reserved/read-only. - # A reserved/read-only partition ID is forbidden in certain documented - # contexts. - # - # Foreign partition IDs (in which the project ID does - # not match the context project ID ) are discouraged. - # Reads and writes of foreign partition IDs may fail if the project is not in - # an active state. - # @!attribute [rw] project_id - # @return [::String] - # The ID of the project to which the entities belong. - # @!attribute [rw] database_id - # @return [::String] - # If not empty, the ID of the database to which the entities - # belong. - # @!attribute [rw] namespace_id - # @return [::String] - # If not empty, the ID of the namespace to which the entities belong. - class PartitionId - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A unique identifier for an entity. - # If a key's partition ID or any of its path kinds or names are - # reserved/read-only, the key is reserved/read-only. - # A reserved/read-only key is forbidden in certain documented contexts. - # @!attribute [rw] partition_id - # @return [::Google::Cloud::Datastore::V1::PartitionId] - # Entities are partitioned into subsets, currently identified by a project - # ID and namespace ID. - # Queries are scoped to a single partition. - # @!attribute [rw] path - # @return [::Array<::Google::Cloud::Datastore::V1::Key::PathElement>] - # The entity path. - # An entity path consists of one or more elements composed of a kind and a - # string or numerical identifier, which identify entities. The first - # element identifies a _root entity_, the second element identifies - # a _child_ of the root entity, the third element identifies a child of the - # second entity, and so forth. The entities identified by all prefixes of - # the path are called the element's _ancestors_. - # - # An entity path is always fully complete: *all* of the entity's ancestors - # are required to be in the path along with the entity identifier itself. - # The only exception is that in some documented cases, the identifier in the - # last path element (for the entity) itself may be omitted. For example, - # the last path element of the key of `Mutation.insert` may have no - # identifier. - # - # A path can never be empty, and a path can have at most 100 elements. - class Key - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A (kind, ID/name) pair used to construct a key path. - # - # If either name or ID is set, the element is complete. - # If neither is set, the element is incomplete. - # @!attribute [rw] kind - # @return [::String] - # The kind of the entity. - # - # A kind matching regex `__.*__` is reserved/read-only. - # A kind must not contain more than 1500 bytes when UTF-8 encoded. - # Cannot be `""`. - # - # Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are - # encoded as `__bytes__` where `` is the base-64 encoding of the - # bytes. - # @!attribute [rw] id - # @return [::Integer] - # The auto-allocated ID of the entity. - # - # Never equal to zero. Values less than zero are discouraged and may not - # be supported in the future. - # @!attribute [rw] name - # @return [::String] - # The name of the entity. - # - # A name matching regex `__.*__` is reserved/read-only. - # A name must not be more than 1500 bytes when UTF-8 encoded. - # Cannot be `""`. - # - # Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are - # encoded as `__bytes__` where `` is the base-64 encoding of the - # bytes. - class PathElement - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # An array value. - # @!attribute [rw] values - # @return [::Array<::Google::Cloud::Datastore::V1::Value>] - # Values in the array. - # The order of values in an array is preserved as long as all values have - # identical settings for 'exclude_from_indexes'. - class ArrayValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message that can hold any of the supported value types and associated - # metadata. - # @!attribute [rw] null_value - # @return [::Google::Protobuf::NullValue] - # A null value. - # @!attribute [rw] boolean_value - # @return [::Boolean] - # A boolean value. - # @!attribute [rw] integer_value - # @return [::Integer] - # An integer value. - # @!attribute [rw] double_value - # @return [::Float] - # A double value. - # @!attribute [rw] timestamp_value - # @return [::Google::Protobuf::Timestamp] - # A timestamp value. - # When stored in the Datastore, precise only to microseconds; - # any additional precision is rounded down. - # @!attribute [rw] key_value - # @return [::Google::Cloud::Datastore::V1::Key] - # A key value. - # @!attribute [rw] string_value - # @return [::String] - # A UTF-8 encoded string value. - # When `exclude_from_indexes` is false (it is indexed) , may have at most - # 1500 bytes. Otherwise, may be set to at most 1,000,000 bytes. - # @!attribute [rw] blob_value - # @return [::String] - # A blob value. - # May have at most 1,000,000 bytes. - # When `exclude_from_indexes` is false, may have at most 1500 bytes. - # In JSON requests, must be base64-encoded. - # @!attribute [rw] geo_point_value - # @return [::Google::Type::LatLng] - # A geo point value representing a point on the surface of Earth. - # @!attribute [rw] entity_value - # @return [::Google::Cloud::Datastore::V1::Entity] - # An entity value. - # - # - May have no key. - # - May have a key with an incomplete key path. - # - May have a reserved/read-only key. - # @!attribute [rw] array_value - # @return [::Google::Cloud::Datastore::V1::ArrayValue] - # An array value. - # Cannot contain another array value. - # A `Value` instance that sets field `array_value` must not set fields - # `meaning` or `exclude_from_indexes`. - # @!attribute [rw] meaning - # @return [::Integer] - # The `meaning` field should only be populated for backwards compatibility. - # @!attribute [rw] exclude_from_indexes - # @return [::Boolean] - # If the value should be excluded from all indexes including those defined - # explicitly. - class Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Datastore data object. - # - # Must not exceed 1 MiB - 4 bytes. - # @!attribute [rw] key - # @return [::Google::Cloud::Datastore::V1::Key] - # The entity's key. - # - # An entity must have a key, unless otherwise documented (for example, - # an entity in `Value.entity_value` may have no key). - # An entity's kind is its key path's last element's kind, - # or null if it has no key. - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Datastore::V1::Value}] - # The entity's properties. - # The map's keys are property names. - # A property name matching regex `__.*__` is reserved. - # A reserved property name is forbidden in certain documented contexts. - # The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot - # be empty. - class Entity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Datastore::V1::Value] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query.rb deleted file mode 100644 index 6b67c1815763..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query.rb +++ /dev/null @@ -1,584 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Datastore - module V1 - # The result of fetching an entity from Datastore. - # @!attribute [rw] entity - # @return [::Google::Cloud::Datastore::V1::Entity] - # The resulting entity. - # @!attribute [rw] version - # @return [::Integer] - # The version of the entity, a strictly positive number that monotonically - # increases with changes to the entity. - # - # This field is set for - # {::Google::Cloud::Datastore::V1::EntityResult::ResultType::FULL `FULL`} entity results. - # - # For {::Google::Cloud::Datastore::V1::LookupResponse#missing missing} entities in - # `LookupResponse`, this is the version of the snapshot that was used to look - # up the entity, and it is always set except for eventually consistent reads. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the entity was created. - # This field is set for - # {::Google::Cloud::Datastore::V1::EntityResult::ResultType::FULL `FULL`} entity results. - # If this entity is missing, this field will not be set. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the entity was last changed. - # This field is set for - # {::Google::Cloud::Datastore::V1::EntityResult::ResultType::FULL `FULL`} entity results. - # If this entity is missing, this field will not be set. - # @!attribute [rw] cursor - # @return [::String] - # A cursor that points to the position after the result entity. - # Set only when the `EntityResult` is part of a `QueryResultBatch` message. - class EntityResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specifies what data the 'entity' field contains. - # A `ResultType` is either implied (for example, in `LookupResponse.missing` - # from `datastore.proto`, it is always `KEY_ONLY`) or specified by context - # (for example, in message `QueryResultBatch`, field `entity_result_type` - # specifies a `ResultType` for all the values in field `entity_results`). - module ResultType - # Unspecified. This value is never used. - RESULT_TYPE_UNSPECIFIED = 0 - - # The key and properties. - FULL = 1 - - # A projected subset of properties. The entity may have no key. - PROJECTION = 2 - - # Only the key. - KEY_ONLY = 3 - end - end - - # A query for entities. - # @!attribute [rw] projection - # @return [::Array<::Google::Cloud::Datastore::V1::Projection>] - # The projection to return. Defaults to returning all properties. - # @!attribute [rw] kind - # @return [::Array<::Google::Cloud::Datastore::V1::KindExpression>] - # The kinds to query (if empty, returns entities of all kinds). - # Currently at most 1 kind may be specified. - # @!attribute [rw] filter - # @return [::Google::Cloud::Datastore::V1::Filter] - # The filter to apply. - # @!attribute [rw] order - # @return [::Array<::Google::Cloud::Datastore::V1::PropertyOrder>] - # The order to apply to the query results (if empty, order is unspecified). - # @!attribute [rw] distinct_on - # @return [::Array<::Google::Cloud::Datastore::V1::PropertyReference>] - # The properties to make distinct. The query results will contain the first - # result for each distinct combination of values for the given properties - # (if empty, all results are returned). - # - # Requires: - # - # * If `order` is specified, the set of distinct on properties must appear - # before the non-distinct on properties in `order`. - # @!attribute [rw] start_cursor - # @return [::String] - # A starting point for the query results. Query cursors are - # returned in query result batches and - # [can only be used to continue the same - # query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - # @!attribute [rw] end_cursor - # @return [::String] - # An ending point for the query results. Query cursors are - # returned in query result batches and - # [can only be used to limit the same - # query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - # @!attribute [rw] offset - # @return [::Integer] - # The number of results to skip. Applies before limit, but after all other - # constraints. Optional. Must be >= 0 if specified. - # @!attribute [rw] limit - # @return [::Google::Protobuf::Int32Value] - # The maximum number of results to return. Applies after all other - # constraints. Optional. - # Unspecified is interpreted as no limit. - # Must be >= 0 if specified. - class Query - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Datastore query for running an aggregation over a - # {::Google::Cloud::Datastore::V1::Query Query}. - # @!attribute [rw] nested_query - # @return [::Google::Cloud::Datastore::V1::Query] - # Nested query for aggregation - # @!attribute [rw] aggregations - # @return [::Array<::Google::Cloud::Datastore::V1::AggregationQuery::Aggregation>] - # Optional. Series of aggregations to apply over the results of the - # `nested_query`. - # - # Requires: - # - # * A minimum of one and maximum of five aggregations per query. - class AggregationQuery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines an aggregation that produces a single result. - # @!attribute [rw] count - # @return [::Google::Cloud::Datastore::V1::AggregationQuery::Aggregation::Count] - # Count aggregator. - # @!attribute [rw] sum - # @return [::Google::Cloud::Datastore::V1::AggregationQuery::Aggregation::Sum] - # Sum aggregator. - # @!attribute [rw] avg - # @return [::Google::Cloud::Datastore::V1::AggregationQuery::Aggregation::Avg] - # Average aggregator. - # @!attribute [rw] alias - # @return [::String] - # Optional. Optional name of the property to store the result of the - # aggregation. - # - # If not provided, Datastore will pick a default name following the format - # `property_`. 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 property_1, - # COUNT_UP_TO(3) AS count_up_to_3, - # COUNT(*) AS property_2 - # OVER ( - # ... - # ); - # ``` - # - # Requires: - # - # * Must be unique across all aggregation aliases. - # * Conform to [entity property - # name][google.datastore.v1.Entity.properties] limitations. - class Aggregation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Count of entities that match the query. - # - # The `COUNT(*)` aggregation function operates on the entire entity - # so it does not require a field reference. - # @!attribute [rw] up_to - # @return [::Google::Protobuf::Int64Value] - # Optional. Optional constraint on the maximum number of entities to - # count. - # - # This provides a way to set an upper bound on the number of entities - # to scan, limiting latency, and cost. - # - # Unspecified is interpreted as no bound. - # - # If a zero value is provided, a count result of zero should always be - # expected. - # - # High-Level Example: - # - # ``` - # AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); - # ``` - # - # Requires: - # - # * Must be non-negative when present. - class Count - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Sum of the values of the requested property. - # - # * 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] property - # @return [::Google::Cloud::Datastore::V1::PropertyReference] - # The property to aggregate on. - class Sum - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Average of the values of the requested property. - # - # * 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] property - # @return [::Google::Cloud::Datastore::V1::PropertyReference] - # The property to aggregate on. - class Avg - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # A representation of a kind. - # @!attribute [rw] name - # @return [::String] - # The name of the kind. - class KindExpression - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A reference to a property relative to the kind expressions. - # @!attribute [rw] name - # @return [::String] - # A reference to a property. - # - # Requires: - # - # * MUST be a dot-delimited (`.`) string of segments, where each segment - # conforms to {::Google::Cloud::Datastore::V1::Entity#properties entity property name} - # limitations. - class PropertyReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A representation of a property in a projection. - # @!attribute [rw] property - # @return [::Google::Cloud::Datastore::V1::PropertyReference] - # The property to project. - class Projection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The desired order for a specific property. - # @!attribute [rw] property - # @return [::Google::Cloud::Datastore::V1::PropertyReference] - # The property to order by. - # @!attribute [rw] direction - # @return [::Google::Cloud::Datastore::V1::PropertyOrder::Direction] - # The direction to order by. Defaults to `ASCENDING`. - class PropertyOrder - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The sort direction. - module Direction - # Unspecified. This value must not be used. - DIRECTION_UNSPECIFIED = 0 - - # Ascending. - ASCENDING = 1 - - # Descending. - DESCENDING = 2 - end - end - - # A holder for any type of filter. - # @!attribute [rw] composite_filter - # @return [::Google::Cloud::Datastore::V1::CompositeFilter] - # A composite filter. - # @!attribute [rw] property_filter - # @return [::Google::Cloud::Datastore::V1::PropertyFilter] - # A filter on a property. - 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::Datastore::V1::CompositeFilter::Operator] - # The operator for combining multiple filters. - # @!attribute [rw] filters - # @return [::Array<::Google::Cloud::Datastore::V1::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 - - # The results are required to satisfy each 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 property. - # @!attribute [rw] property - # @return [::Google::Cloud::Datastore::V1::PropertyReference] - # The property to filter by. - # @!attribute [rw] op - # @return [::Google::Cloud::Datastore::V1::PropertyFilter::Operator] - # The operator to filter by. - # @!attribute [rw] value - # @return [::Google::Cloud::Datastore::V1::Value] - # The value to compare the property to. - class PropertyFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A property filter operator. - module Operator - # Unspecified. This value must not be used. - OPERATOR_UNSPECIFIED = 0 - - # The given `property` is less than the given `value`. - # - # Requires: - # - # * That `property` comes first in `order_by`. - LESS_THAN = 1 - - # The given `property` is less than or equal to the given `value`. - # - # Requires: - # - # * That `property` comes first in `order_by`. - LESS_THAN_OR_EQUAL = 2 - - # The given `property` is greater than the given `value`. - # - # Requires: - # - # * That `property` comes first in `order_by`. - GREATER_THAN = 3 - - # The given `property` is greater than or equal to the given `value`. - # - # Requires: - # - # * That `property` comes first in `order_by`. - GREATER_THAN_OR_EQUAL = 4 - - # The given `property` is equal to the given `value`. - EQUAL = 5 - - # The given `property` 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` is in the same query. - IN = 6 - - # The given `property` is not equal to the given `value`. - # - # Requires: - # - # * No other `NOT_EQUAL` or `NOT_IN` is in the same query. - # * That `property` comes first in the `order_by`. - NOT_EQUAL = 9 - - # Limit the result set to the given entity and its descendants. - # - # Requires: - # - # * That `value` is an entity key. - # * All evaluated disjunctions must have the same `HAS_ANCESTOR` filter. - HAS_ANCESTOR = 11 - - # The value of the `property` is not in the given array. - # - # Requires: - # - # * That `value` is a non-empty `ArrayValue` with at most 10 values. - # * No other `OR`, `IN`, `NOT_IN`, `NOT_EQUAL` is in the same query. - # * That `field` comes first in the `order_by`. - NOT_IN = 13 - end - end - - # A [GQL - # query](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). - # @!attribute [rw] query_string - # @return [::String] - # A string of the format described - # [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). - # @!attribute [rw] allow_literals - # @return [::Boolean] - # When false, the query string must not contain any literals and instead must - # bind all values. For example, - # `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while - # `SELECT * FROM Kind WHERE a = @value` is. - # @!attribute [rw] named_bindings - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Datastore::V1::GqlQueryParameter}] - # For each non-reserved named binding site in the query string, there must be - # a named parameter with that name, but not necessarily the inverse. - # - # Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex - # `__.*__`, and must not be `""`. - # @!attribute [rw] positional_bindings - # @return [::Array<::Google::Cloud::Datastore::V1::GqlQueryParameter>] - # Numbered binding site @1 references the first numbered parameter, - # effectively using 1-based indexing, rather than the usual 0. - # - # For each binding site numbered i in `query_string`, there must be an i-th - # numbered parameter. The inverse must also be true. - class GqlQuery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Datastore::V1::GqlQueryParameter] - class NamedBindingsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A binding parameter for a GQL query. - # @!attribute [rw] value - # @return [::Google::Cloud::Datastore::V1::Value] - # A value parameter. - # @!attribute [rw] cursor - # @return [::String] - # A query cursor. Query cursors are returned in query - # result batches. - class GqlQueryParameter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A batch of results produced by a query. - # @!attribute [rw] skipped_results - # @return [::Integer] - # The number of results skipped, typically because of an offset. - # @!attribute [rw] skipped_cursor - # @return [::String] - # A cursor that points to the position after the last skipped result. - # Will be set when `skipped_results` != 0. - # @!attribute [rw] entity_result_type - # @return [::Google::Cloud::Datastore::V1::EntityResult::ResultType] - # The result type for every entity in `entity_results`. - # @!attribute [rw] entity_results - # @return [::Array<::Google::Cloud::Datastore::V1::EntityResult>] - # The results for this batch. - # @!attribute [rw] end_cursor - # @return [::String] - # A cursor that points to the position after the last result in the batch. - # @!attribute [rw] more_results - # @return [::Google::Cloud::Datastore::V1::QueryResultBatch::MoreResultsType] - # The state of the query after the current batch. - # @!attribute [rw] snapshot_version - # @return [::Integer] - # The version number of the snapshot this batch was returned from. - # This applies to the range of results from the query's `start_cursor` (or - # the beginning of the query if no cursor was given) to this batch's - # `end_cursor` (not the query's `end_cursor`). - # - # In a single transaction, subsequent query result batches for the same query - # can have a greater snapshot version number. Each batch's snapshot version - # is valid for all preceding batches. - # The value will be zero for eventually consistent queries. - # @!attribute [rw] read_time - # @return [::Google::Protobuf::Timestamp] - # Read timestamp this batch was returned from. - # This applies to the range of results from the query's `start_cursor` (or - # the beginning of the query if no cursor was given) to this batch's - # `end_cursor` (not the query's `end_cursor`). - # - # In a single transaction, subsequent query result batches for the same query - # can have a greater timestamp. Each batch's read timestamp - # is valid for all preceding batches. - # This value will not be set for eventually consistent queries in Cloud - # Datastore. - class QueryResultBatch - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The possible values for the `more_results` field. - module MoreResultsType - # Unspecified. This value is never used. - MORE_RESULTS_TYPE_UNSPECIFIED = 0 - - # There may be additional batches to fetch from this query. - NOT_FINISHED = 1 - - # The query is finished, but there may be more results after the limit. - MORE_RESULTS_AFTER_LIMIT = 2 - - # The query is finished, but there may be more results after the end - # cursor. - MORE_RESULTS_AFTER_CURSOR = 4 - - # The query is finished, and there are no more results. - NO_MORE_RESULTS = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query_profile.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query_profile.rb deleted file mode 100644 index 8ba0b16599c2..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/datastore/v1/query_profile.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Datastore - 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::Datastore::V1::PlanSummary] - # Planning phase information for the query. - # @!attribute [rw] execution_stats - # @return [::Google::Cloud::Datastore::V1::ExecutionStats] - # Aggregated stats from the execution of the query. Only present when - # {::Google::Cloud::Datastore::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-datastore-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index b5731a824060..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 9e96368be9d9..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/struct.rb +++ /dev/null @@ -1,96 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `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. - # @!attribute [rw] number_value - # @return [::Float] - # Represents a double value. - # @!attribute [rw] string_value - # @return [::String] - # Represents a string value. - # @!attribute [rw] bool_value - # @return [::Boolean] - # Represents a boolean value. - # @!attribute [rw] struct_value - # @return [::Google::Protobuf::Struct] - # Represents a structured value. - # @!attribute [rw] list_value - # @return [::Google::Protobuf::ListValue] - # Represents a repeated `Value`. - 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-datastore-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 4ac9c4801a3f..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 5160138862c2..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # 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-datastore-v1/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/type/latlng.rb deleted file mode 100644 index 0d9e1c6995f8..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/proto_docs/google/type/latlng.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # 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-datastore-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-datastore-v1/snippets/Gemfile deleted file mode 100644 index ef4adfd7cebc..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-datastore-v1", path: "../" -else - gem "google-cloud-datastore-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-datastore-v1/snippets/datastore/allocate_ids.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/allocate_ids.rb deleted file mode 100644 index e83f5777eac8..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/allocate_ids.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START datastore_v1_generated_Datastore_AllocateIds_sync] -require "google/cloud/datastore/v1" - -## -# Snippet for the allocate_ids call in the Datastore 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::Datastore::V1::Datastore::Client#allocate_ids. -# -def allocate_ids - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Datastore::V1::Datastore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Datastore::V1::AllocateIdsRequest.new - - # Call the allocate_ids method. - result = client.allocate_ids request - - # The returned object is of type Google::Cloud::Datastore::V1::AllocateIdsResponse. - p result -end -# [END datastore_v1_generated_Datastore_AllocateIds_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/begin_transaction.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/begin_transaction.rb deleted file mode 100644 index 71022abcd3c7..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/begin_transaction.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START datastore_v1_generated_Datastore_BeginTransaction_sync] -require "google/cloud/datastore/v1" - -## -# Snippet for the begin_transaction call in the Datastore 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::Datastore::V1::Datastore::Client#begin_transaction. -# -def begin_transaction - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Datastore::V1::Datastore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Datastore::V1::BeginTransactionRequest.new - - # Call the begin_transaction method. - result = client.begin_transaction request - - # The returned object is of type Google::Cloud::Datastore::V1::BeginTransactionResponse. - p result -end -# [END datastore_v1_generated_Datastore_BeginTransaction_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/commit.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/commit.rb deleted file mode 100644 index a4304d2ea44f..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/commit.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START datastore_v1_generated_Datastore_Commit_sync] -require "google/cloud/datastore/v1" - -## -# Snippet for the commit call in the Datastore 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::Datastore::V1::Datastore::Client#commit. -# -def commit - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Datastore::V1::Datastore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Datastore::V1::CommitRequest.new - - # Call the commit method. - result = client.commit request - - # The returned object is of type Google::Cloud::Datastore::V1::CommitResponse. - p result -end -# [END datastore_v1_generated_Datastore_Commit_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/lookup.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/lookup.rb deleted file mode 100644 index f90ceda5c050..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/lookup.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START datastore_v1_generated_Datastore_Lookup_sync] -require "google/cloud/datastore/v1" - -## -# Snippet for the lookup call in the Datastore 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::Datastore::V1::Datastore::Client#lookup. -# -def lookup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Datastore::V1::Datastore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Datastore::V1::LookupRequest.new - - # Call the lookup method. - result = client.lookup request - - # The returned object is of type Google::Cloud::Datastore::V1::LookupResponse. - p result -end -# [END datastore_v1_generated_Datastore_Lookup_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/reserve_ids.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/reserve_ids.rb deleted file mode 100644 index 5a865df12b73..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/reserve_ids.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START datastore_v1_generated_Datastore_ReserveIds_sync] -require "google/cloud/datastore/v1" - -## -# Snippet for the reserve_ids call in the Datastore 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::Datastore::V1::Datastore::Client#reserve_ids. -# -def reserve_ids - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Datastore::V1::Datastore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Datastore::V1::ReserveIdsRequest.new - - # Call the reserve_ids method. - result = client.reserve_ids request - - # The returned object is of type Google::Cloud::Datastore::V1::ReserveIdsResponse. - p result -end -# [END datastore_v1_generated_Datastore_ReserveIds_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/rollback.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/rollback.rb deleted file mode 100644 index 1264f2b64c82..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/rollback.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START datastore_v1_generated_Datastore_Rollback_sync] -require "google/cloud/datastore/v1" - -## -# Snippet for the rollback call in the Datastore 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::Datastore::V1::Datastore::Client#rollback. -# -def rollback - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Datastore::V1::Datastore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Datastore::V1::RollbackRequest.new - - # Call the rollback method. - result = client.rollback request - - # The returned object is of type Google::Cloud::Datastore::V1::RollbackResponse. - p result -end -# [END datastore_v1_generated_Datastore_Rollback_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_aggregation_query.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_aggregation_query.rb deleted file mode 100644 index 90ddd2aacdcc..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_aggregation_query.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START datastore_v1_generated_Datastore_RunAggregationQuery_sync] -require "google/cloud/datastore/v1" - -## -# Snippet for the run_aggregation_query call in the Datastore 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::Datastore::V1::Datastore::Client#run_aggregation_query. -# -def run_aggregation_query - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Datastore::V1::Datastore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new - - # Call the run_aggregation_query method. - result = client.run_aggregation_query request - - # The returned object is of type Google::Cloud::Datastore::V1::RunAggregationQueryResponse. - p result -end -# [END datastore_v1_generated_Datastore_RunAggregationQuery_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_query.rb b/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_query.rb deleted file mode 100644 index 312adc5ff186..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/snippets/datastore/run_query.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START datastore_v1_generated_Datastore_RunQuery_sync] -require "google/cloud/datastore/v1" - -## -# Snippet for the run_query call in the Datastore 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::Datastore::V1::Datastore::Client#run_query. -# -def run_query - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Datastore::V1::Datastore::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Datastore::V1::RunQueryRequest.new - - # Call the run_query method. - result = client.run_query request - - # The returned object is of type Google::Cloud::Datastore::V1::RunQueryResponse. - p result -end -# [END datastore_v1_generated_Datastore_RunQuery_sync] diff --git a/owl-bot-staging/google-cloud-datastore-v1/snippets/snippet_metadata_google.datastore.v1.json b/owl-bot-staging/google-cloud-datastore-v1/snippets/snippet_metadata_google.datastore.v1.json deleted file mode 100644 index 8fa45d1cb04f..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/snippets/snippet_metadata_google.datastore.v1.json +++ /dev/null @@ -1,335 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-datastore-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.datastore.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "datastore_v1_generated_Datastore_Lookup_sync", - "title": "Snippet for the lookup call in the Datastore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#lookup.", - "file": "datastore/lookup.rb", - "language": "RUBY", - "client_method": { - "short_name": "lookup", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#lookup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Datastore::V1::LookupRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Datastore::V1::LookupResponse", - "client": { - "short_name": "Datastore::Client", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" - }, - "method": { - "short_name": "Lookup", - "full_name": "google.datastore.v1.Datastore.Lookup", - "service": { - "short_name": "Datastore", - "full_name": "google.datastore.v1.Datastore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "datastore_v1_generated_Datastore_RunQuery_sync", - "title": "Snippet for the run_query call in the Datastore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#run_query.", - "file": "datastore/run_query.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_query", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#run_query", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Datastore::V1::RunQueryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Datastore::V1::RunQueryResponse", - "client": { - "short_name": "Datastore::Client", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" - }, - "method": { - "short_name": "RunQuery", - "full_name": "google.datastore.v1.Datastore.RunQuery", - "service": { - "short_name": "Datastore", - "full_name": "google.datastore.v1.Datastore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "datastore_v1_generated_Datastore_RunAggregationQuery_sync", - "title": "Snippet for the run_aggregation_query call in the Datastore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#run_aggregation_query.", - "file": "datastore/run_aggregation_query.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_aggregation_query", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#run_aggregation_query", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Datastore::V1::RunAggregationQueryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Datastore::V1::RunAggregationQueryResponse", - "client": { - "short_name": "Datastore::Client", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" - }, - "method": { - "short_name": "RunAggregationQuery", - "full_name": "google.datastore.v1.Datastore.RunAggregationQuery", - "service": { - "short_name": "Datastore", - "full_name": "google.datastore.v1.Datastore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "datastore_v1_generated_Datastore_BeginTransaction_sync", - "title": "Snippet for the begin_transaction call in the Datastore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction.", - "file": "datastore/begin_transaction.rb", - "language": "RUBY", - "client_method": { - "short_name": "begin_transaction", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Datastore::V1::BeginTransactionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Datastore::V1::BeginTransactionResponse", - "client": { - "short_name": "Datastore::Client", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" - }, - "method": { - "short_name": "BeginTransaction", - "full_name": "google.datastore.v1.Datastore.BeginTransaction", - "service": { - "short_name": "Datastore", - "full_name": "google.datastore.v1.Datastore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "datastore_v1_generated_Datastore_Commit_sync", - "title": "Snippet for the commit call in the Datastore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#commit.", - "file": "datastore/commit.rb", - "language": "RUBY", - "client_method": { - "short_name": "commit", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#commit", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Datastore::V1::CommitRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Datastore::V1::CommitResponse", - "client": { - "short_name": "Datastore::Client", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" - }, - "method": { - "short_name": "Commit", - "full_name": "google.datastore.v1.Datastore.Commit", - "service": { - "short_name": "Datastore", - "full_name": "google.datastore.v1.Datastore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "datastore_v1_generated_Datastore_Rollback_sync", - "title": "Snippet for the rollback call in the Datastore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#rollback.", - "file": "datastore/rollback.rb", - "language": "RUBY", - "client_method": { - "short_name": "rollback", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#rollback", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Datastore::V1::RollbackRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Datastore::V1::RollbackResponse", - "client": { - "short_name": "Datastore::Client", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" - }, - "method": { - "short_name": "Rollback", - "full_name": "google.datastore.v1.Datastore.Rollback", - "service": { - "short_name": "Datastore", - "full_name": "google.datastore.v1.Datastore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "datastore_v1_generated_Datastore_AllocateIds_sync", - "title": "Snippet for the allocate_ids call in the Datastore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#allocate_ids.", - "file": "datastore/allocate_ids.rb", - "language": "RUBY", - "client_method": { - "short_name": "allocate_ids", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#allocate_ids", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Datastore::V1::AllocateIdsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Datastore::V1::AllocateIdsResponse", - "client": { - "short_name": "Datastore::Client", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" - }, - "method": { - "short_name": "AllocateIds", - "full_name": "google.datastore.v1.Datastore.AllocateIds", - "service": { - "short_name": "Datastore", - "full_name": "google.datastore.v1.Datastore" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "datastore_v1_generated_Datastore_ReserveIds_sync", - "title": "Snippet for the reserve_ids call in the Datastore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Datastore::V1::Datastore::Client#reserve_ids.", - "file": "datastore/reserve_ids.rb", - "language": "RUBY", - "client_method": { - "short_name": "reserve_ids", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client#reserve_ids", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Datastore::V1::ReserveIdsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Datastore::V1::ReserveIdsResponse", - "client": { - "short_name": "Datastore::Client", - "full_name": "::Google::Cloud::Datastore::V1::Datastore::Client" - }, - "method": { - "short_name": "ReserveIds", - "full_name": "google.datastore.v1.Datastore.ReserveIds", - "service": { - "short_name": "Datastore", - "full_name": "google.datastore.v1.Datastore" - } - } - }, - "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-datastore-v1/test/google/cloud/datastore/v1/datastore_rest_test.rb b/owl-bot-staging/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_rest_test.rb deleted file mode 100644 index 7b193b26d9cb..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_rest_test.rb +++ /dev/null @@ -1,550 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/datastore/v1/datastore_pb" -require "google/cloud/datastore/v1/datastore/rest" - - -class ::Google::Cloud::Datastore::V1::Datastore::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_lookup - # Create test objects. - client_result = ::Google::Cloud::Datastore::V1::LookupResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - database_id = "hello world" - read_options = {} - keys = [{}] - property_mask = {} - - lookup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.stub :transcode_lookup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, lookup_client_stub do - # Create client - client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.lookup({ project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.lookup project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.lookup ::Google::Cloud::Datastore::V1::LookupRequest.new(project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.lookup({ project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.lookup(::Google::Cloud::Datastore::V1::LookupRequest.new(project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, lookup_client_stub.call_count - end - end - end - - def test_run_query - # Create test objects. - client_result = ::Google::Cloud::Datastore::V1::RunQueryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - database_id = "hello world" - partition_id = {} - read_options = {} - query = {} - property_mask = {} - explain_options = {} - - run_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.stub :transcode_run_query_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, run_query_client_stub do - # Create client - client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.run_query project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.run_query ::Google::Cloud::Datastore::V1::RunQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.run_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.run_query(::Google::Cloud::Datastore::V1::RunQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, run_query_client_stub.call_count - end - end - end - - def test_run_aggregation_query - # Create test objects. - client_result = ::Google::Cloud::Datastore::V1::RunAggregationQueryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - database_id = "hello world" - partition_id = {} - read_options = {} - aggregation_query = {} - explain_options = {} - - run_aggregation_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Datastore::V1::Datastore::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::Datastore::V1::Datastore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_aggregation_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.run_aggregation_query project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.run_aggregation_query ::Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.run_aggregation_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.run_aggregation_query(::Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, run_aggregation_query_client_stub.call_count - end - end - end - - def test_begin_transaction - # Create test objects. - client_result = ::Google::Cloud::Datastore::V1::BeginTransactionResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - database_id = "hello world" - transaction_options = {} - - begin_transaction_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.stub :transcode_begin_transaction_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, begin_transaction_client_stub do - # Create client - client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.begin_transaction({ project_id: project_id, database_id: database_id, transaction_options: transaction_options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.begin_transaction project_id: project_id, database_id: database_id, transaction_options: transaction_options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.begin_transaction ::Google::Cloud::Datastore::V1::BeginTransactionRequest.new(project_id: project_id, database_id: database_id, transaction_options: transaction_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.begin_transaction({ project_id: project_id, database_id: database_id, transaction_options: transaction_options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.begin_transaction(::Google::Cloud::Datastore::V1::BeginTransactionRequest.new(project_id: project_id, database_id: database_id, transaction_options: transaction_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::Datastore::V1::CommitResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - database_id = "hello world" - mode = :MODE_UNSPECIFIED - transaction = "hello world" - mutations = [{}] - - commit_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.stub :transcode_commit_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, commit_client_stub do - # Create client - client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.commit({ project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.commit project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.commit ::Google::Cloud::Datastore::V1::CommitRequest.new(project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.commit({ project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.commit(::Google::Cloud::Datastore::V1::CommitRequest.new(project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations), 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::Cloud::Datastore::V1::RollbackResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - database_id = "hello world" - transaction = "hello world" - - rollback_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.stub :transcode_rollback_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, rollback_client_stub do - # Create client - client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.rollback({ project_id: project_id, database_id: database_id, transaction: transaction }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.rollback project_id: project_id, database_id: database_id, transaction: transaction do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.rollback ::Google::Cloud::Datastore::V1::RollbackRequest.new(project_id: project_id, database_id: database_id, transaction: transaction) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.rollback({ project_id: project_id, database_id: database_id, transaction: transaction }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.rollback(::Google::Cloud::Datastore::V1::RollbackRequest.new(project_id: project_id, database_id: database_id, 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_allocate_ids - # Create test objects. - client_result = ::Google::Cloud::Datastore::V1::AllocateIdsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - database_id = "hello world" - keys = [{}] - - allocate_ids_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.stub :transcode_allocate_ids_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, allocate_ids_client_stub do - # Create client - client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.allocate_ids({ project_id: project_id, database_id: database_id, keys: keys }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.allocate_ids project_id: project_id, database_id: database_id, keys: keys do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.allocate_ids ::Google::Cloud::Datastore::V1::AllocateIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.allocate_ids({ project_id: project_id, database_id: database_id, keys: keys }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.allocate_ids(::Google::Cloud::Datastore::V1::AllocateIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, allocate_ids_client_stub.call_count - end - end - end - - def test_reserve_ids - # Create test objects. - client_result = ::Google::Cloud::Datastore::V1::ReserveIdsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - database_id = "hello world" - keys = [{}] - - reserve_ids_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Datastore::V1::Datastore::Rest::ServiceStub.stub :transcode_reserve_ids_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, reserve_ids_client_stub do - # Create client - client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.reserve_ids({ project_id: project_id, database_id: database_id, keys: keys }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.reserve_ids project_id: project_id, database_id: database_id, keys: keys do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.reserve_ids ::Google::Cloud::Datastore::V1::ReserveIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.reserve_ids({ project_id: project_id, database_id: database_id, keys: keys }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.reserve_ids(::Google::Cloud::Datastore::V1::ReserveIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, reserve_ids_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::Datastore::V1::Datastore::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::Datastore::V1::Datastore::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_test.rb b/owl-bot-staging/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_test.rb deleted file mode 100644 index 8449e52369b4..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_test.rb +++ /dev/null @@ -1,597 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/datastore/v1/datastore_pb" -require "google/datastore/v1/datastore_services_pb" -require "google/cloud/datastore/v1/datastore" - -class ::Google::Cloud::Datastore::V1::Datastore::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_lookup - # Create GRPC objects. - grpc_response = ::Google::Cloud::Datastore::V1::LookupResponse.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. - project_id = "hello world" - database_id = "hello world" - read_options = {} - keys = [{}] - property_mask = {} - - lookup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :lookup, name - assert_kind_of ::Google::Cloud::Datastore::V1::LookupRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["database_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::ReadOptions), request["read_options"] - assert_kind_of ::Google::Cloud::Datastore::V1::Key, request["keys"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::PropertyMask), request["property_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, lookup_client_stub do - # Create client - client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.lookup({ project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.lookup project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.lookup ::Google::Cloud::Datastore::V1::LookupRequest.new(project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.lookup({ project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.lookup(::Google::Cloud::Datastore::V1::LookupRequest.new(project_id: project_id, database_id: database_id, read_options: read_options, keys: keys, property_mask: property_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, lookup_client_stub.call_rpc_count - end - end - - def test_run_query - # Create GRPC objects. - grpc_response = ::Google::Cloud::Datastore::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 unary method. - project_id = "hello world" - database_id = "hello world" - partition_id = {} - read_options = {} - query = {} - property_mask = {} - explain_options = {} - - run_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :run_query, name - assert_kind_of ::Google::Cloud::Datastore::V1::RunQueryRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["database_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::PartitionId), request["partition_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::ReadOptions), request["read_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::Query), request["query"] - assert_equal :query, request.query_type - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::PropertyMask), request["property_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::ExplainOptions), request["explain_options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_query_client_stub do - # Create client - client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.run_query project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.run_query ::Google::Cloud::Datastore::V1::RunQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.run_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.run_query(::Google::Cloud::Datastore::V1::RunQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, query: query, property_mask: property_mask, explain_options: explain_options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, run_query_client_stub.call_rpc_count - end - end - - def test_run_aggregation_query - # Create GRPC objects. - grpc_response = ::Google::Cloud::Datastore::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 unary method. - project_id = "hello world" - database_id = "hello world" - partition_id = {} - read_options = {} - aggregation_query = {} - explain_options = {} - - run_aggregation_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :run_aggregation_query, name - assert_kind_of ::Google::Cloud::Datastore::V1::RunAggregationQueryRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["database_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::PartitionId), request["partition_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::ReadOptions), request["read_options"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::AggregationQuery), request["aggregation_query"] - assert_equal :aggregation_query, request.query_type - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::ExplainOptions), request["explain_options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_aggregation_query_client_stub do - # Create client - client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_aggregation_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.run_aggregation_query project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.run_aggregation_query ::Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.run_aggregation_query({ project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.run_aggregation_query(::Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new(project_id: project_id, database_id: database_id, partition_id: partition_id, read_options: read_options, aggregation_query: aggregation_query, explain_options: explain_options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, run_aggregation_query_client_stub.call_rpc_count - end - end - - def test_begin_transaction - # Create GRPC objects. - grpc_response = ::Google::Cloud::Datastore::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. - project_id = "hello world" - database_id = "hello world" - transaction_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::Datastore::V1::BeginTransactionRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["database_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Datastore::V1::TransactionOptions), request["transaction_options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, begin_transaction_client_stub do - # Create client - client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.begin_transaction({ project_id: project_id, database_id: database_id, transaction_options: transaction_options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.begin_transaction project_id: project_id, database_id: database_id, transaction_options: transaction_options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.begin_transaction ::Google::Cloud::Datastore::V1::BeginTransactionRequest.new(project_id: project_id, database_id: database_id, transaction_options: transaction_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.begin_transaction({ project_id: project_id, database_id: database_id, transaction_options: transaction_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::Datastore::V1::BeginTransactionRequest.new(project_id: project_id, database_id: database_id, transaction_options: transaction_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::Datastore::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. - project_id = "hello world" - database_id = "hello world" - mode = :MODE_UNSPECIFIED - transaction = "hello world" - mutations = [{}] - - commit_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :commit, name - assert_kind_of ::Google::Cloud::Datastore::V1::CommitRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["database_id"] - assert_equal :MODE_UNSPECIFIED, request["mode"] - assert_equal "hello world", request["transaction"] - assert_equal :transaction, request.transaction_selector - assert_kind_of ::Google::Cloud::Datastore::V1::Mutation, request["mutations"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, commit_client_stub do - # Create client - client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.commit({ project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.commit project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.commit ::Google::Cloud::Datastore::V1::CommitRequest.new(project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.commit({ project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations }, 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::Datastore::V1::CommitRequest.new(project_id: project_id, database_id: database_id, mode: mode, transaction: transaction, mutations: mutations), 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::Cloud::Datastore::V1::RollbackResponse.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. - project_id = "hello world" - database_id = "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::Datastore::V1::RollbackRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["database_id"] - assert_equal "hello world", request["transaction"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, rollback_client_stub do - # Create client - client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.rollback({ project_id: project_id, database_id: database_id, transaction: transaction }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.rollback project_id: project_id, database_id: database_id, transaction: transaction do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.rollback ::Google::Cloud::Datastore::V1::RollbackRequest.new(project_id: project_id, database_id: database_id, transaction: transaction) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.rollback({ project_id: project_id, database_id: database_id, 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::Datastore::V1::RollbackRequest.new(project_id: project_id, database_id: database_id, 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_allocate_ids - # Create GRPC objects. - grpc_response = ::Google::Cloud::Datastore::V1::AllocateIdsResponse.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. - project_id = "hello world" - database_id = "hello world" - keys = [{}] - - allocate_ids_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :allocate_ids, name - assert_kind_of ::Google::Cloud::Datastore::V1::AllocateIdsRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["database_id"] - assert_kind_of ::Google::Cloud::Datastore::V1::Key, request["keys"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, allocate_ids_client_stub do - # Create client - client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.allocate_ids({ project_id: project_id, database_id: database_id, keys: keys }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.allocate_ids project_id: project_id, database_id: database_id, keys: keys do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.allocate_ids ::Google::Cloud::Datastore::V1::AllocateIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.allocate_ids({ project_id: project_id, database_id: database_id, keys: keys }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.allocate_ids(::Google::Cloud::Datastore::V1::AllocateIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, allocate_ids_client_stub.call_rpc_count - end - end - - def test_reserve_ids - # Create GRPC objects. - grpc_response = ::Google::Cloud::Datastore::V1::ReserveIdsResponse.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. - project_id = "hello world" - database_id = "hello world" - keys = [{}] - - reserve_ids_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :reserve_ids, name - assert_kind_of ::Google::Cloud::Datastore::V1::ReserveIdsRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["database_id"] - assert_kind_of ::Google::Cloud::Datastore::V1::Key, request["keys"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, reserve_ids_client_stub do - # Create client - client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.reserve_ids({ project_id: project_id, database_id: database_id, keys: keys }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.reserve_ids project_id: project_id, database_id: database_id, keys: keys do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.reserve_ids ::Google::Cloud::Datastore::V1::ReserveIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.reserve_ids({ project_id: project_id, database_id: database_id, keys: keys }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.reserve_ids(::Google::Cloud::Datastore::V1::ReserveIdsRequest.new(project_id: project_id, database_id: database_id, keys: keys), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, reserve_ids_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::Datastore::V1::Datastore::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::Datastore::V1::Datastore::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-datastore-v1/test/helper.rb b/owl-bot-staging/google-cloud-datastore-v1/test/helper.rb deleted file mode 100644 index 48407bca7edb..000000000000 --- a/owl-bot-staging/google-cloud-datastore-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"