From 89ed43c92b1df3161b1c2117c6c2f3f5b7361a97 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 29 Dec 2025 22:06:35 +0000 Subject: [PATCH 1/2] docs: change comment indicating `enable_gemini_in_bigquery` field for BigQuery Reservation Assignments is deprecated PiperOrigin-RevId: 850121797 Source-Link: https://github.com/googleapis/googleapis/commit/94ccedca05acb0bb60780789e93371c9e4100ddc Source-Link: https://github.com/googleapis/googleapis-gen/commit/2c4bd384f040db59d078fc0ca5196c28b27cbc71 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWJpZ3F1ZXJ5LXJlc2VydmF0aW9uLXYxLy5Pd2xCb3QueWFtbCIsImgiOiIyYzRiZDM4NGYwNDBkYjU5ZDA3OGZjMGNhNTE5NmMyOGIyN2NiYzcxIn0= --- .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 11 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 163 + ...ogle-cloud-bigquery-reservation-v1.gemspec | 29 + .../google-cloud-bigquery-reservation-v1.rb | 21 + .../google/cloud/bigquery/reservation/v1.rb | 47 + .../bigquery/reservation/v1/reservation_pb.rb | 106 + .../reservation/v1/reservation_service.rb | 71 + .../v1/reservation_service/client.rb | 3514 +++++++++++++++++ .../v1/reservation_service/credentials.rb | 54 + .../v1/reservation_service/paths.rb | 147 + .../v1/reservation_service/rest.rb | 68 + .../v1/reservation_service/rest/client.rb | 3266 +++++++++++++++ .../reservation_service/rest/service_stub.rb | 1889 +++++++++ .../reservation/v1/reservation_services_pb.rb | 297 ++ .../cloud/bigquery/reservation/v1/rest.rb | 39 + .../cloud/bigquery/reservation/v1/version.rb | 30 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 +++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 ++ .../bigquery/reservation/v1/reservation.rb | 1190 ++++++ .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 ++ .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../reservation_service/create_assignment.rb | 47 + .../create_capacity_commitment.rb | 47 + .../reservation_service/create_reservation.rb | 47 + .../create_reservation_group.rb | 47 + .../reservation_service/delete_assignment.rb | 47 + .../delete_capacity_commitment.rb | 47 + .../reservation_service/delete_reservation.rb | 47 + .../delete_reservation_group.rb | 47 + .../failover_reservation.rb | 47 + .../reservation_service/get_bi_reservation.rb | 47 + .../get_capacity_commitment.rb | 47 + .../reservation_service/get_iam_policy.rb | 47 + .../reservation_service/get_reservation.rb | 47 + .../get_reservation_group.rb | 47 + .../reservation_service/list_assignments.rb | 51 + .../list_capacity_commitments.rb | 51 + .../list_reservation_groups.rb | 51 + .../reservation_service/list_reservations.rb | 51 + .../merge_capacity_commitments.rb | 47 + .../reservation_service/move_assignment.rb | 47 + .../search_all_assignments.rb | 51 + .../reservation_service/search_assignments.rb | 51 + .../reservation_service/set_iam_policy.rb | 47 + .../split_capacity_commitment.rb | 47 + .../test_iam_permissions.rb | 47 + .../reservation_service/update_assignment.rb | 47 + .../update_bi_reservation.rb | 47 + .../update_capacity_commitment.rb | 47 + .../reservation_service/update_reservation.rb | 47 + ..._google.cloud.bigquery.reservation.v1.json | 1175 ++++++ .../v1/reservation_service_paths_test.rb | 115 + .../v1/reservation_service_rest_test.rb | 1703 ++++++++ .../v1/reservation_service_test.rb | 1892 +++++++++ .../test/helper.rb | 25 + 77 files changed, 20211 insertions(+) create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/README.md create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/google-cloud-bigquery-reservation-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google-cloud-bigquery-reservation-v1.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_pb.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/client.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/cloud/bigquery/reservation/v1/reservation.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_assignment.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_capacity_commitment.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation_group.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_assignment.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_capacity_commitment.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation_group.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/failover_reservation.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_bi_reservation.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_capacity_commitment.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation_group.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_assignments.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_capacity_commitments.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservation_groups.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservations.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/merge_capacity_commitments.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/move_assignment.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_all_assignments.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_assignments.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/split_capacity_commitment.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_assignment.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_bi_reservation.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_capacity_commitment.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_reservation.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/snippet_metadata_google.cloud.bigquery.reservation.v1.json create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_test.rb create mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/.gitignore b/owl-bot-staging/google-cloud-bigquery-reservation-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-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-bigquery-reservation-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-bigquery-reservation-v1/.repo-metadata.json new file mode 100644 index 000000000000..a2ae9c6f27bd --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "bigqueryreservation.googleapis.com", + "api_shortname": "bigqueryreservation", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-bigquery-reservation-v1/latest", + "distribution_name": "google-cloud-bigquery-reservation-v1", + "is_cloud": true, + "language": "ruby", + "name": "bigqueryreservation", + "name_pretty": "BigQuery Reservation V1 API", + "product_documentation": "https://cloud.google.com/bigquery/docs/reference/reservations", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "The BigQuery Reservation API provides the mechanisms by which enterprise users can provision and manage dedicated resources such as slots and BigQuery BI Engine memory allocations. Note that google-cloud-bigquery-reservation-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-bigquery-reservation instead. See the readme for more details.", + "ruby-cloud-env-prefix": "BIGQUERY_RESERVATION", + "ruby-cloud-product-url": "https://cloud.google.com/bigquery/docs/reference/reservations", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/.rubocop.yml b/owl-bot-staging/google-cloud-bigquery-reservation-v1/.rubocop.yml new file mode 100644 index 000000000000..9001cc0bde65 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-bigquery-reservation-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-bigquery-reservation-v1.rb" diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/.toys.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/.toys.rb new file mode 100644 index 000000000000..9a210f1427c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/.yardopts b/owl-bot-staging/google-cloud-bigquery-reservation-v1/.yardopts new file mode 100644 index 000000000000..9fa1700ac9d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="BigQuery Reservation 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-bigquery-reservation-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-bigquery-reservation-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..0b1eacbc181a --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-bigquery-reservation-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-bigquery-reservation-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/bigquery/reservation/v1" + +client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/bigquery/reservation/v1" + +::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::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-bigquery-reservation-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/bigquery/reservation/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::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-bigquery-reservation-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-bigquery-reservation-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/Gemfile b/owl-bot-staging/google-cloud-bigquery-reservation-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/LICENSE.md b/owl-bot-staging/google-cloud-bigquery-reservation-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-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-bigquery-reservation-v1/README.md b/owl-bot-staging/google-cloud-bigquery-reservation-v1/README.md new file mode 100644 index 000000000000..38259ede0f03 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the BigQuery Reservation V1 API + +A service to modify your BigQuery reservations. + +The BigQuery Reservation API provides the mechanisms by which enterprise users can provision and manage dedicated resources such as slots and BigQuery BI Engine memory allocations. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the BigQuery Reservation V1 API. Most users should consider using +the main client gem, +[google-cloud-bigquery-reservation](https://rubygems.org/gems/google-cloud-bigquery-reservation). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-bigquery-reservation-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/bigqueryreservation.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/bigquery/reservation/v1" + +client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +request = ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new # (request fields as keyword arguments...) +response = client.create_reservation request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-bigquery-reservation-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/bigquery/docs/reference/reservations) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/bigquery/reservation/v1" +require "logger" + +client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-bigquery-reservation`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-bigquery-reservation-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-bigquery-reservation`. +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-bigquery-reservation-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-bigquery-reservation-v1/Rakefile b/owl-bot-staging/google-cloud-bigquery-reservation-v1/Rakefile new file mode 100644 index 000000000000..6811c14b96be --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-bigquery-reservation-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["BIGQUERY_RESERVATION_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["BIGQUERY_RESERVATION_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["BIGQUERY_RESERVATION_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 BIGQUERY_RESERVATION_TEST_PROJECT=test123 BIGQUERY_RESERVATION_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/bigquery/reservation/v1/reservation_service/credentials" + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["BIGQUERY_RESERVATION_PROJECT"] = project + ENV["BIGQUERY_RESERVATION_TEST_PROJECT"] = project + ENV["BIGQUERY_RESERVATION_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-bigquery-reservation-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-bigquery-reservation-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-bigquery-reservation-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-bigquery-reservation-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-bigquery-reservation-v1" + header "google-cloud-bigquery-reservation-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-bigquery-reservation-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-bigquery-reservation-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-bigquery-reservation-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-bigquery-reservation-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-bigquery-reservation-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-bigquery-reservation-v1/gapic_metadata.json new file mode 100644 index 000000000000..effdec3d98a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/gapic_metadata.json @@ -0,0 +1,163 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.bigquery.reservation.v1", + "libraryPackage": "::Google::Cloud::Bigquery::Reservation::V1", + "services": { + "ReservationService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client", + "rpcs": { + "CreateReservation": { + "methods": [ + "create_reservation" + ] + }, + "ListReservations": { + "methods": [ + "list_reservations" + ] + }, + "GetReservation": { + "methods": [ + "get_reservation" + ] + }, + "DeleteReservation": { + "methods": [ + "delete_reservation" + ] + }, + "UpdateReservation": { + "methods": [ + "update_reservation" + ] + }, + "FailoverReservation": { + "methods": [ + "failover_reservation" + ] + }, + "CreateCapacityCommitment": { + "methods": [ + "create_capacity_commitment" + ] + }, + "ListCapacityCommitments": { + "methods": [ + "list_capacity_commitments" + ] + }, + "GetCapacityCommitment": { + "methods": [ + "get_capacity_commitment" + ] + }, + "DeleteCapacityCommitment": { + "methods": [ + "delete_capacity_commitment" + ] + }, + "UpdateCapacityCommitment": { + "methods": [ + "update_capacity_commitment" + ] + }, + "SplitCapacityCommitment": { + "methods": [ + "split_capacity_commitment" + ] + }, + "MergeCapacityCommitments": { + "methods": [ + "merge_capacity_commitments" + ] + }, + "CreateAssignment": { + "methods": [ + "create_assignment" + ] + }, + "ListAssignments": { + "methods": [ + "list_assignments" + ] + }, + "DeleteAssignment": { + "methods": [ + "delete_assignment" + ] + }, + "SearchAssignments": { + "methods": [ + "search_assignments" + ] + }, + "SearchAllAssignments": { + "methods": [ + "search_all_assignments" + ] + }, + "MoveAssignment": { + "methods": [ + "move_assignment" + ] + }, + "UpdateAssignment": { + "methods": [ + "update_assignment" + ] + }, + "GetBiReservation": { + "methods": [ + "get_bi_reservation" + ] + }, + "UpdateBiReservation": { + "methods": [ + "update_bi_reservation" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + }, + "CreateReservationGroup": { + "methods": [ + "create_reservation_group" + ] + }, + "GetReservationGroup": { + "methods": [ + "get_reservation_group" + ] + }, + "DeleteReservationGroup": { + "methods": [ + "delete_reservation_group" + ] + }, + "ListReservationGroups": { + "methods": [ + "list_reservation_groups" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/google-cloud-bigquery-reservation-v1.gemspec b/owl-bot-staging/google-cloud-bigquery-reservation-v1/google-cloud-bigquery-reservation-v1.gemspec new file mode 100644 index 000000000000..e0a09d200815 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/google-cloud-bigquery-reservation-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/bigquery/reservation/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-bigquery-reservation-v1" + gem.version = Google::Cloud::Bigquery::Reservation::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "The BigQuery Reservation API provides the mechanisms by which enterprise users can provision and manage dedicated resources such as slots and BigQuery BI Engine memory allocations. Note that google-cloud-bigquery-reservation-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-bigquery-reservation instead. See the readme for more details." + gem.summary = "A service to modify your BigQuery reservations." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google-cloud-bigquery-reservation-v1.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google-cloud-bigquery-reservation-v1.rb new file mode 100644 index 000000000000..c75b1a6a63a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google-cloud-bigquery-reservation-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/bigquery/reservation/v1" diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1.rb new file mode 100644 index 000000000000..748152a8a78b --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/bigquery/reservation/v1/reservation_service" +require "google/cloud/bigquery/reservation/v1/version" + +module Google + module Cloud + module Bigquery + module Reservation + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/bigquery/reservation/v1" + # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/bigquery/reservation/v1" + # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + module V1 + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/bigquery/reservation/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_pb.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_pb.rb new file mode 100644 index 000000000000..af0ae70246b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_pb.rb @@ -0,0 +1,106 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/bigquery/reservation/v1/reservation.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n6google/cloud/bigquery/reservation/v1/reservation.proto\x12$google.cloud.bigquery.reservation.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xfc\x0c\n\x0bReservation\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1a\n\rslot_capacity\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1e\n\x11ignore_idle_slots\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12S\n\tautoscale\x18\x07 \x01(\x0b\x32;.google.cloud.bigquery.reservation.v1.Reservation.AutoscaleB\x03\xe0\x41\x01\x12\x18\n\x0b\x63oncurrency\x18\x10 \x01(\x03\x42\x03\xe0\x41\x01\x12\x36\n\rcreation_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\"\n\x16multi_region_auxiliary\x18\x0e \x01(\x08\x42\x02\x18\x01\x12\x43\n\x07\x65\x64ition\x18\x11 \x01(\x0e\x32-.google.cloud.bigquery.reservation.v1.EditionB\x03\xe0\x41\x01\x12\x43\n\x10primary_location\x18\x12 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!locations.googleapis.com/Location\x12\x45\n\x12secondary_location\x18\x13 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!locations.googleapis.com/Location\x12L\n\x19original_primary_location\x18\x14 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!locations.googleapis.com/Location\x12\x1b\n\tmax_slots\x18\x15 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12X\n\x0cscaling_mode\x18\x16 \x01(\x0e\x32=.google.cloud.bigquery.reservation.v1.Reservation.ScalingModeB\x03\xe0\x41\x01\x12R\n\x06labels\x18\x17 \x03(\x0b\x32=.google.cloud.bigquery.reservation.v1.Reservation.LabelsEntryB\x03\xe0\x41\x01\x12\x1e\n\x11reservation_group\x18\x19 \x01(\tB\x03\xe0\x41\x01\x12\x64\n\x12replication_status\x18\x18 \x01(\x0b\x32\x43.google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatusB\x03\xe0\x41\x03\x12V\n\x11scheduling_policy\x18\x1b \x01(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.SchedulingPolicyB\x03\xe0\x41\x01\x1a?\n\tAutoscale\x12\x1a\n\rcurrent_slots\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x16\n\tmax_slots\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x1a\xf8\x01\n\x11ReplicationStatus\x12&\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x38\n\x0flast_error_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12>\n\x15last_replication_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x18soft_failover_start_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"c\n\x0bScalingMode\x12\x1c\n\x18SCALING_MODE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x41UTOSCALE_ONLY\x10\x01\x12\x13\n\x0fIDLE_SLOTS_ONLY\x10\x02\x12\r\n\tALL_SLOTS\x10\x03:w\xea\x41t\n.bigqueryreservation.googleapis.com/Reservation\x12\x42projects/{project}/locations/{location}/reservations/{reservation}B\x0c\n\n_max_slots\"l\n\x10SchedulingPolicy\x12\x1d\n\x0b\x63oncurrency\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1b\n\tmax_slots\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x0e\n\x0c_concurrencyB\x0c\n\n_max_slots\"\xd5\x01\n\x10ReservationGroup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08:\xad\x01\xea\x41\xa9\x01\n3bigqueryreservation.googleapis.com/ReservationGroup\x12Mprojects/{project}/locations/{location}/reservationGroups/{reservation_group}*\x11reservationGroups2\x10reservationGroup\"\xaa\x08\n\x12\x43\x61pacityCommitment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nslot_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12Z\n\x04plan\x18\x03 \x01(\x0e\x32G.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlanB\x03\xe0\x41\x01\x12R\n\x05state\x18\x04 \x01(\x0e\x32>.google.cloud.bigquery.reservation.v1.CapacityCommitment.StateB\x03\xe0\x41\x03\x12>\n\x15\x63ommitment_start_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x13\x63ommitment_end_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12/\n\x0e\x66\x61ilure_status\x18\x07 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x62\n\x0crenewal_plan\x18\x08 \x01(\x0e\x32G.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlanB\x03\xe0\x41\x01\x12\"\n\x16multi_region_auxiliary\x18\n \x01(\x08\x42\x02\x18\x01\x12\x43\n\x07\x65\x64ition\x18\x0c \x01(\x0e\x32-.google.cloud.bigquery.reservation.v1.EditionB\x03\xe0\x41\x01\x12\x19\n\x0cis_flat_rate\x18\x0e \x01(\x08\x42\x03\xe0\x41\x03\"\xca\x01\n\x0e\x43ommitmentPlan\x12\x1f\n\x1b\x43OMMITMENT_PLAN_UNSPECIFIED\x10\x00\x12\x08\n\x04\x46LEX\x10\x03\x12\x16\n\x0e\x46LEX_FLAT_RATE\x10\x07\x1a\x02\x08\x01\x12\r\n\x05TRIAL\x10\x05\x1a\x02\x08\x01\x12\x0b\n\x07MONTHLY\x10\x02\x12\x19\n\x11MONTHLY_FLAT_RATE\x10\x08\x1a\x02\x08\x01\x12\n\n\x06\x41NNUAL\x10\x04\x12\x18\n\x10\x41NNUAL_FLAT_RATE\x10\t\x1a\x02\x08\x01\x12\x0e\n\nTHREE_YEAR\x10\n\x12\x08\n\x04NONE\x10\x06\"C\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03:\x8e\x01\xea\x41\x8a\x01\n5bigqueryreservation.googleapis.com/CapacityCommitment\x12Qprojects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}\"\xc2\x01\n\x18\x43reateReservationRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.bigqueryreservation.googleapis.com/Reservation\x12\x16\n\x0ereservation_id\x18\x02 \x01(\t\x12\x46\n\x0breservation\x18\x03 \x01(\x0b\x32\x31.google.cloud.bigquery.reservation.v1.Reservation\"\x88\x01\n\x17ListReservationsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.bigqueryreservation.googleapis.com/Reservation\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"|\n\x18ListReservationsResponse\x12G\n\x0creservations\x18\x01 \x03(\x0b\x32\x31.google.cloud.bigquery.reservation.v1.Reservation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x15GetReservationRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.bigqueryreservation.googleapis.com/Reservation\"`\n\x18\x44\x65leteReservationRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.bigqueryreservation.googleapis.com/Reservation\"\x93\x01\n\x18UpdateReservationRequest\x12\x46\n\x0breservation\x18\x01 \x01(\x0b\x32\x31.google.cloud.bigquery.reservation.v1.Reservation\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xb2\x01\n\x1a\x46\x61iloverReservationRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.bigqueryreservation.googleapis.com/Reservation\x12N\n\rfailover_mode\x18\x02 \x01(\x0e\x32\x32.google.cloud.bigquery.reservation.v1.FailoverModeB\x03\xe0\x41\x01\"\xe7\x01\n\x1d\x43reateReservationGroupRequest\x12K\n\x06parent\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\x12\x33\x62igqueryreservation.googleapis.com/ReservationGroup\x12!\n\x14reservation_group_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12V\n\x11reservation_group\x18\x03 \x01(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.ReservationGroupB\x03\xe0\x41\x02\"g\n\x1aGetReservationGroupRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3bigqueryreservation.googleapis.com/ReservationGroup\"\x92\x01\n\x1cListReservationGroupsRequest\x12K\n\x06parent\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\x12\x33\x62igqueryreservation.googleapis.com/ReservationGroup\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x8c\x01\n\x1dListReservationGroupsResponse\x12R\n\x12reservation_groups\x18\x01 \x03(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.ReservationGroup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"j\n\x1d\x44\x65leteReservationGroupRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3bigqueryreservation.googleapis.com/ReservationGroup\"\x95\x02\n\x1f\x43reateCapacityCommitmentRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35\x62igqueryreservation.googleapis.com/CapacityCommitment\x12U\n\x13\x63\x61pacity_commitment\x18\x02 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12,\n$enforce_single_admin_project_per_org\x18\x04 \x01(\x08\x12\x1e\n\x16\x63\x61pacity_commitment_id\x18\x05 \x01(\t\"\x96\x01\n\x1eListCapacityCommitmentsRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35\x62igqueryreservation.googleapis.com/CapacityCommitment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x92\x01\n\x1fListCapacityCommitmentsResponse\x12V\n\x14\x63\x61pacity_commitments\x18\x01 \x03(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"k\n\x1cGetCapacityCommitmentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5bigqueryreservation.googleapis.com/CapacityCommitment\"}\n\x1f\x44\x65leteCapacityCommitmentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5bigqueryreservation.googleapis.com/CapacityCommitment\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\"\xa9\x01\n\x1fUpdateCapacityCommitmentRequest\x12U\n\x13\x63\x61pacity_commitment\x18\x01 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x81\x01\n\x1eSplitCapacityCommitmentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5bigqueryreservation.googleapis.com/CapacityCommitment\x12\x12\n\nslot_count\x18\x02 \x01(\x03\"\xb4\x01\n\x1fSplitCapacityCommitmentResponse\x12G\n\x05\x66irst\x18\x01 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12H\n\x06second\x18\x02 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\"\xb3\x01\n\x1fMergeCapacityCommitmentsRequest\x12J\n\x06parent\x18\x01 \x01(\tB:\xfa\x41\x37\x12\x35\x62igqueryreservation.googleapis.com/CapacityCommitment\x12\x1f\n\x17\x63\x61pacity_commitment_ids\x18\x02 \x03(\t\x12#\n\x16\x63\x61pacity_commitment_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x99\x06\n\nAssignment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08\x61ssignee\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12O\n\x08job_type\x18\x03 \x01(\x0e\x32\x38.google.cloud.bigquery.reservation.v1.Assignment.JobTypeB\x03\xe0\x41\x01\x12J\n\x05state\x18\x06 \x01(\x0e\x32\x36.google.cloud.bigquery.reservation.v1.Assignment.StateB\x03\xe0\x41\x03\x12(\n\x19\x65nable_gemini_in_bigquery\x18\n \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12V\n\x11scheduling_policy\x18\x0b \x01(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.SchedulingPolicyB\x03\xe0\x41\x01\"\xdc\x01\n\x07JobType\x12\x18\n\x14JOB_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08PIPELINE\x10\x01\x12\t\n\x05QUERY\x10\x02\x12\x0f\n\x0bML_EXTERNAL\x10\x03\x12\x0e\n\nBACKGROUND\x10\x04\x12\x0e\n\nCONTINUOUS\x10\x06\x12\"\n\x1e\x42\x41\x43KGROUND_CHANGE_DATA_CAPTURE\x10\x07\x12$\n BACKGROUND_COLUMN_METADATA_INDEX\x10\x08\x12#\n\x1f\x42\x41\x43KGROUND_SEARCH_INDEX_REFRESH\x10\t\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02:\xa9\x01\xea\x41\xa5\x01\n-bigqueryreservation.googleapis.com/Assignment\x12[projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}*\x0b\x61ssignments2\nassignment\"\xbd\x01\n\x17\x43reateAssignmentRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-bigqueryreservation.googleapis.com/Assignment\x12\x44\n\nassignment\x18\x02 \x01(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x15\n\rassignment_id\x18\x04 \x01(\t\"\x86\x01\n\x16ListAssignmentsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-bigqueryreservation.googleapis.com/Assignment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"y\n\x17ListAssignmentsResponse\x12\x45\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"^\n\x17\x44\x65leteAssignmentRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-bigqueryreservation.googleapis.com/Assignment\"\x8b\x01\n\x18SearchAssignmentsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\r\n\x05query\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"\x8e\x01\n\x1bSearchAllAssignmentsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\r\n\x05query\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"{\n\x19SearchAssignmentsResponse\x12\x45\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"~\n\x1cSearchAllAssignmentsResponse\x12\x45\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xbf\x01\n\x15MoveAssignmentRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-bigqueryreservation.googleapis.com/Assignment\x12J\n\x0e\x64\x65stination_id\x18\x03 \x01(\tB2\xfa\x41/\x12-bigqueryreservation.googleapis.com/Assignment\x12\x15\n\rassignment_id\x18\x05 \x01(\t\"\x90\x01\n\x17UpdateAssignmentRequest\x12\x44\n\nassignment\x18\x01 \x01(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"Y\n\x0eTableReference\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\ndataset_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08table_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xae\x02\n\rBiReservation\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04size\x18\x04 \x01(\x03\x42\x03\xe0\x41\x01\x12S\n\x10preferred_tables\x18\x05 \x03(\x0b\x32\x34.google.cloud.bigquery.reservation.v1.TableReferenceB\x03\xe0\x41\x01:l\xea\x41i\n0bigqueryreservation.googleapis.com/BiReservation\x12\x35projects/{project}/locations/{location}/biReservation\"a\n\x17GetBiReservationRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0bigqueryreservation.googleapis.com/BiReservation\"\x9a\x01\n\x1aUpdateBiReservationRequest\x12K\n\x0e\x62i_reservation\x18\x01 \x01(\x0b\x32\x33.google.cloud.bigquery.reservation.v1.BiReservation\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask*U\n\x07\x45\x64ition\x12\x17\n\x13\x45\x44ITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x0e\n\nENTERPRISE\x10\x02\x12\x13\n\x0f\x45NTERPRISE_PLUS\x10\x03*A\n\x0c\x46\x61iloverMode\x12\x1d\n\x19\x46\x41ILOVER_MODE_UNSPECIFIED\x10\x00\x12\x08\n\x04SOFT\x10\x01\x12\x08\n\x04HARD\x10\x02\x32\xa3\x36\n\x12ReservationService\x12\xf1\x01\n\x11\x43reateReservation\x12>.google.cloud.bigquery.reservation.v1.CreateReservationRequest\x1a\x31.google.cloud.bigquery.reservation.v1.Reservation\"i\xda\x41!parent,reservation,reservation_id\x82\xd3\xe4\x93\x02?\"0/v1/{parent=projects/*/locations/*}/reservations:\x0breservation\x12\xd4\x01\n\x10ListReservations\x12=.google.cloud.bigquery.reservation.v1.ListReservationsRequest\x1a>.google.cloud.bigquery.reservation.v1.ListReservationsResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{parent=projects/*/locations/*}/reservations\x12\xc1\x01\n\x0eGetReservation\x12;.google.cloud.bigquery.reservation.v1.GetReservationRequest\x1a\x31.google.cloud.bigquery.reservation.v1.Reservation\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{name=projects/*/locations/*/reservations/*}\x12\xac\x01\n\x11\x44\x65leteReservation\x12>.google.cloud.bigquery.reservation.v1.DeleteReservationRequest\x1a\x16.google.protobuf.Empty\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32*0/v1/{name=projects/*/locations/*/reservations/*}\x12\xf3\x01\n\x11UpdateReservation\x12>.google.cloud.bigquery.reservation.v1.UpdateReservationRequest\x1a\x31.google.cloud.bigquery.reservation.v1.Reservation\"k\xda\x41\x17reservation,update_mask\x82\xd3\xe4\x93\x02K2/v1/{parent=projects/*/locations/*/reservations/*}/assignments:\nassignment\x12\xdf\x01\n\x0fListAssignments\x12<.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest\x1a=.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1/{parent=projects/*/locations/*/reservations/*}/assignments\x12\xb8\x01\n\x10\x44\x65leteAssignment\x12=.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest\x1a\x16.google.protobuf.Empty\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@*>/v1/{name=projects/*/locations/*/reservations/*/assignments/*}\x12\xe5\x01\n\x11SearchAssignments\x12>.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest\x1a?.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse\"O\x88\x02\x01\xda\x41\x0cparent,query\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*}:searchAssignments\x12\xee\x01\n\x14SearchAllAssignments\x12\x41.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest\x1a\x42.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse\"O\xda\x41\x0cparent,query\x82\xd3\xe4\x93\x02:\x12\x38/v1/{parent=projects/*/locations/*}:searchAllAssignments\x12\xe5\x01\n\x0eMoveAssignment\x12;.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest\x1a\x30.google.cloud.bigquery.reservation.v1.Assignment\"d\xda\x41\x13name,destination_id\x82\xd3\xe4\x93\x02H\"C/v1/{name=projects/*/locations/*/reservations/*/assignments/*}:move:\x01*\x12\xfb\x01\n\x10UpdateAssignment\x12=.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest\x1a\x30.google.cloud.bigquery.reservation.v1.Assignment\"v\xda\x41\x16\x61ssignment,update_mask\x82\xd3\xe4\x93\x02W2I/v1/{assignment.name=projects/*/locations/*/reservations/*/assignments/*}:\nassignment\x12\xc6\x01\n\x10GetBiReservation\x12=.google.cloud.bigquery.reservation.v1.GetBiReservationRequest\x1a\x33.google.cloud.bigquery.reservation.v1.BiReservation\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v1/{name=projects/*/locations/*/biReservation}\x12\x81\x02\n\x13UpdateBiReservation\x12@.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest\x1a\x33.google.cloud.bigquery.reservation.v1.BiReservation\"s\xda\x41\x1a\x62i_reservation,update_mask\x82\xd3\xe4\x93\x02P2>/v1/{bi_reservation.name=projects/*/locations/*/biReservation}:\x0e\x62i_reservation\x12\xf4\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xa8\x01\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x96\x01\x12\x41/v1/{resource=projects/*/locations/*/reservations/*}:getIamPolicyZQ\x12O/v1/{resource=projects/*/locations/*/reservations/*/assignments/*}:getIamPolicy\x12\x81\x02\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xb5\x01\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x9c\x01\"A/v1/{resource=projects/*/locations/*/reservations/*}:setIamPolicy:\x01*ZT\"O/v1/{resource=projects/*/locations/*/reservations/*/assignments/*}:setIamPolicy:\x01*\x12\x9b\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\xaf\x01\x82\xd3\xe4\x93\x02\xa8\x01\"G/v1/{resource=projects/*/locations/*/reservations/*}:testIamPermissions:\x01*ZZ\"U/v1/{resource=projects/*/locations/*/reservations/*/assignments/*}:testIamPermissions:\x01*\x12\xe7\x01\n\x16\x43reateReservationGroup\x12\x43.google.cloud.bigquery.reservation.v1.CreateReservationGroupRequest\x1a\x36.google.cloud.bigquery.reservation.v1.ReservationGroup\"P\x82\xd3\xe4\x93\x02J\"5/v1/{parent=projects/*/locations/*}/reservationGroups:\x11reservation_group\x12\xd5\x01\n\x13GetReservationGroup\x12@.google.cloud.bigquery.reservation.v1.GetReservationGroupRequest\x1a\x36.google.cloud.bigquery.reservation.v1.ReservationGroup\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/reservationGroups/*}\x12\xbb\x01\n\x16\x44\x65leteReservationGroup\x12\x43.google.cloud.bigquery.reservation.v1.DeleteReservationGroupRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v1/{name=projects/*/locations/*/reservationGroups/*}\x12\xe8\x01\n\x15ListReservationGroups\x12\x42.google.cloud.bigquery.reservation.v1.ListReservationGroupsRequest\x1a\x43.google.cloud.bigquery.reservation.v1.ListReservationGroupsResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*}/reservationGroups\x1a\x7f\xca\x41\"bigqueryreservation.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platformB\xd8\x01\n(com.google.cloud.bigquery.reservation.v1B\x10ReservationProtoP\x01ZJcloud.google.com/go/bigquery/reservation/apiv1/reservationpb;reservationpb\xaa\x02$Google.Cloud.BigQuery.Reservation.V1\xca\x02$Google\\Cloud\\BigQuery\\Reservation\\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.rpc.Status", "google/rpc/status.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.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 Bigquery + module Reservation + module V1 + Reservation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Reservation").msgclass + Reservation::Autoscale = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Reservation.Autoscale").msgclass + Reservation::ReplicationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus").msgclass + Reservation::ScalingMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Reservation.ScalingMode").enummodule + SchedulingPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.SchedulingPolicy").msgclass + ReservationGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ReservationGroup").msgclass + CapacityCommitment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.CapacityCommitment").msgclass + CapacityCommitment::CommitmentPlan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan").enummodule + CapacityCommitment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.CapacityCommitment.State").enummodule + CreateReservationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.CreateReservationRequest").msgclass + ListReservationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListReservationsRequest").msgclass + ListReservationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListReservationsResponse").msgclass + GetReservationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.GetReservationRequest").msgclass + DeleteReservationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.DeleteReservationRequest").msgclass + UpdateReservationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.UpdateReservationRequest").msgclass + FailoverReservationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.FailoverReservationRequest").msgclass + CreateReservationGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.CreateReservationGroupRequest").msgclass + GetReservationGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.GetReservationGroupRequest").msgclass + ListReservationGroupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListReservationGroupsRequest").msgclass + ListReservationGroupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListReservationGroupsResponse").msgclass + DeleteReservationGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.DeleteReservationGroupRequest").msgclass + CreateCapacityCommitmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest").msgclass + ListCapacityCommitmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest").msgclass + ListCapacityCommitmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse").msgclass + GetCapacityCommitmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest").msgclass + DeleteCapacityCommitmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest").msgclass + UpdateCapacityCommitmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest").msgclass + SplitCapacityCommitmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest").msgclass + SplitCapacityCommitmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse").msgclass + MergeCapacityCommitmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest").msgclass + Assignment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Assignment").msgclass + Assignment::JobType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Assignment.JobType").enummodule + Assignment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Assignment.State").enummodule + CreateAssignmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.CreateAssignmentRequest").msgclass + ListAssignmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListAssignmentsRequest").msgclass + ListAssignmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListAssignmentsResponse").msgclass + DeleteAssignmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest").msgclass + SearchAssignmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest").msgclass + SearchAllAssignmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest").msgclass + SearchAssignmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse").msgclass + SearchAllAssignmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse").msgclass + MoveAssignmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.MoveAssignmentRequest").msgclass + UpdateAssignmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest").msgclass + TableReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.TableReference").msgclass + BiReservation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.BiReservation").msgclass + GetBiReservationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.GetBiReservationRequest").msgclass + UpdateBiReservationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest").msgclass + Edition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Edition").enummodule + FailoverMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.FailoverMode").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service.rb new file mode 100644 index 000000000000..b3b9c9d8284d --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/bigquery/reservation/v1/version" + +require "google/cloud/bigquery/reservation/v1/reservation_service/credentials" +require "google/cloud/bigquery/reservation/v1/reservation_service/paths" +require "google/cloud/bigquery/reservation/v1/reservation_service/client" +require "google/cloud/bigquery/reservation/v1/reservation_service/rest" + +module Google + module Cloud + module Bigquery + module Reservation + module V1 + ## + # This API allows users to manage their BigQuery reservations. + # + # A reservation provides computational resource guarantees, in the form of + # [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a + # unit of computational power in BigQuery, and serves as the basic unit of + # parallelism. In a scan of a multi-partitioned table, a single slot operates + # on a single partition of the table. A reservation resource exists as a child + # resource of the admin project and location, e.g.: + # `projects/myproject/locations/US/reservations/reservationName`. + # + # A capacity commitment is a way to purchase compute capacity for BigQuery jobs + # (in the form of slots) with some committed period of usage. A capacity + # commitment resource exists as a child resource of the admin project and + # location, e.g.: + # `projects/myproject/locations/US/capacityCommitments/id`. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/bigquery/reservation/v1/reservation_service" + # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/bigquery/reservation/v1/reservation_service/rest" + # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + module ReservationService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "reservation_service", "helpers.rb" +require "google/cloud/bigquery/reservation/v1/reservation_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/client.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/client.rb new file mode 100644 index 000000000000..8b56210e38fb --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/client.rb @@ -0,0 +1,3514 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/bigquery/reservation/v1/reservation_pb" + +module Google + module Cloud + module Bigquery + module Reservation + module V1 + module ReservationService + ## + # Client for the ReservationService service. + # + # This API allows users to manage their BigQuery reservations. + # + # A reservation provides computational resource guarantees, in the form of + # [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a + # unit of computational power in BigQuery, and serves as the basic unit of + # parallelism. In a scan of a multi-partitioned table, a single slot operates + # on a single partition of the table. A reservation resource exists as a child + # resource of the admin project and location, e.g.: + # `projects/myproject/locations/US/reservations/reservationName`. + # + # A capacity commitment is a way to purchase compute capacity for BigQuery jobs + # (in the form of slots) with some committed period of usage. A capacity + # commitment resource exists as a child resource of the admin project and + # location, e.g.: + # `projects/myproject/locations/US/capacityCommitments/id`. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "bigqueryreservation.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :reservation_service_stub + + ## + # Configure the ReservationService Client class. + # + # See {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ReservationService clients + # ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::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", "Bigquery", "Reservation", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_reservation.timeout = 300.0 + + default_config.rpcs.list_reservations.timeout = 300.0 + default_config.rpcs.list_reservations.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_reservation.timeout = 300.0 + default_config.rpcs.get_reservation.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.delete_reservation.timeout = 300.0 + default_config.rpcs.delete_reservation.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_reservation.timeout = 300.0 + + default_config.rpcs.failover_reservation.timeout = 300.0 + + default_config.rpcs.create_capacity_commitment.timeout = 300.0 + + default_config.rpcs.list_capacity_commitments.timeout = 300.0 + default_config.rpcs.list_capacity_commitments.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_capacity_commitment.timeout = 300.0 + default_config.rpcs.get_capacity_commitment.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.delete_capacity_commitment.timeout = 300.0 + default_config.rpcs.delete_capacity_commitment.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_capacity_commitment.timeout = 300.0 + + default_config.rpcs.split_capacity_commitment.timeout = 300.0 + + default_config.rpcs.merge_capacity_commitments.timeout = 300.0 + + default_config.rpcs.create_assignment.timeout = 300.0 + + default_config.rpcs.list_assignments.timeout = 300.0 + default_config.rpcs.list_assignments.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.delete_assignment.timeout = 300.0 + default_config.rpcs.delete_assignment.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_assignments.timeout = 300.0 + default_config.rpcs.search_assignments.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.move_assignment.timeout = 300.0 + + default_config.rpcs.get_bi_reservation.timeout = 300.0 + default_config.rpcs.get_bi_reservation.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_bi_reservation.timeout = 300.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ReservationService 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::Bigquery::Reservation::V1::ReservationService::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 + @reservation_service_stub.universe_domain + end + + ## + # Create a new ReservationService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ReservationService 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/cloud/bigquery/reservation/v1/reservation_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 + + @reservation_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @reservation_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @reservation_service_stub.logger + end + + # Service calls + + ## + # Creates a new reservation resource. + # + # @overload create_reservation(request, options = nil) + # Pass arguments to `create_reservation` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_reservation(parent: nil, reservation_id: nil, reservation: nil) + # Pass arguments to `create_reservation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Project, location. E.g., + # `projects/myproject/locations/US` + # @param reservation_id [::String] + # The reservation ID. It must only contain lower case alphanumeric + # characters or dashes. It must start with a letter and must not end + # with a dash. Its maximum length is 64 characters. + # @param reservation [::Google::Cloud::Bigquery::Reservation::V1::Reservation, ::Hash] + # Definition of the new reservation to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new + # + # # Call the create_reservation method. + # result = client.create_reservation request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. + # p result + # + def create_reservation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_reservation.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_reservation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_reservation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :create_reservation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the reservations for the project in the specified location. + # + # @overload list_reservations(request, options = nil) + # Pass arguments to `list_reservations` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_reservations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_reservations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name containing project and location, e.g.: + # `projects/myproject/locations/US` + # @param page_size [::Integer] + # The maximum number of items to return per page. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Reservation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Reservation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new + # + # # Call the list_reservations method. + # result = client.list_reservations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Reservation. + # p item + # end + # + def list_reservations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_reservations.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_reservations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_reservations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :list_reservations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @reservation_service_stub, :list_reservations, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns information about the reservation. + # + # @overload get_reservation(request, options = nil) + # Pass arguments to `get_reservation` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_reservation(name: nil) + # Pass arguments to `get_reservation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the reservation to retrieve. E.g., + # `projects/myproject/locations/US/reservations/team1-prod` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new + # + # # Call the get_reservation method. + # result = client.get_reservation request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. + # p result + # + def get_reservation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_reservation.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_reservation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_reservation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :get_reservation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a reservation. + # Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + # assignments. + # + # @overload delete_reservation(request, options = nil) + # Pass arguments to `delete_reservation` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_reservation(name: nil) + # Pass arguments to `delete_reservation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the reservation to retrieve. E.g., + # `projects/myproject/locations/US/reservations/team1-prod` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new + # + # # Call the delete_reservation method. + # result = client.delete_reservation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_reservation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_reservation.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_reservation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_reservation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :delete_reservation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an existing reservation resource. + # + # @overload update_reservation(request, options = nil) + # Pass arguments to `update_reservation` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_reservation(reservation: nil, update_mask: nil) + # Pass arguments to `update_reservation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param reservation [::Google::Cloud::Bigquery::Reservation::V1::Reservation, ::Hash] + # Content of the reservation to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Standard field mask for the set of fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new + # + # # Call the update_reservation method. + # result = client.update_reservation request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. + # p result + # + def update_reservation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_reservation.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::Bigquery::Reservation::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.reservation&.name + header_params["reservation.name"] = request.reservation.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_reservation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_reservation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :update_reservation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Fail over a reservation to the secondary location. The operation should be + # done in the current secondary location, which will be promoted to the + # new primary location for the reservation. + # Attempting to failover a reservation in the current primary location will + # fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + # + # @overload failover_reservation(request, options = nil) + # Pass arguments to `failover_reservation` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload failover_reservation(name: nil, failover_mode: nil) + # Pass arguments to `failover_reservation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the reservation to failover. E.g., + # `projects/myproject/locations/US/reservations/team1-prod` + # @param failover_mode [::Google::Cloud::Bigquery::Reservation::V1::FailoverMode] + # Optional. A parameter that determines how writes that are pending + # replication are handled after a failover is initiated. If not specified, + # HARD failover mode is used by default. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest.new + # + # # Call the failover_reservation method. + # result = client.failover_reservation request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. + # p result + # + def failover_reservation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest + + # Converts hash 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.failover_reservation.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.failover_reservation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.failover_reservation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :failover_reservation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new capacity commitment resource. + # + # @overload create_capacity_commitment(request, options = nil) + # Pass arguments to `create_capacity_commitment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_capacity_commitment(parent: nil, capacity_commitment: nil, enforce_single_admin_project_per_org: nil, capacity_commitment_id: nil) + # Pass arguments to `create_capacity_commitment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the parent reservation. E.g., + # `projects/myproject/locations/US` + # @param capacity_commitment [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment, ::Hash] + # Content of the capacity commitment to create. + # @param enforce_single_admin_project_per_org [::Boolean] + # If true, fail the request if another project in the organization has a + # capacity commitment. + # @param capacity_commitment_id [::String] + # The optional capacity commitment ID. Capacity commitment name will be + # generated automatically if this field is empty. + # This field must only contain lower case alphanumeric characters or dashes. + # The first and last character cannot be a dash. Max length is 64 characters. + # NOTE: this ID won't be kept if the capacity commitment is split or merged. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new + # + # # Call the create_capacity_commitment method. + # result = client.create_capacity_commitment request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + # p result + # + def create_capacity_commitment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_capacity_commitment.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_capacity_commitment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_capacity_commitment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :create_capacity_commitment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the capacity commitments for the admin project. + # + # @overload list_capacity_commitments(request, options = nil) + # Pass arguments to `list_capacity_commitments` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_capacity_commitments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_capacity_commitments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the parent reservation. E.g., + # `projects/myproject/locations/US` + # @param page_size [::Integer] + # The maximum number of items to return. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new + # + # # Call the list_capacity_commitments method. + # result = client.list_capacity_commitments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + # p item + # end + # + def list_capacity_commitments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_capacity_commitments.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_capacity_commitments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_capacity_commitments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :list_capacity_commitments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @reservation_service_stub, :list_capacity_commitments, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns information about the capacity commitment. + # + # @overload get_capacity_commitment(request, options = nil) + # Pass arguments to `get_capacity_commitment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_capacity_commitment(name: nil) + # Pass arguments to `get_capacity_commitment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the capacity commitment to retrieve. E.g., + # `projects/myproject/locations/US/capacityCommitments/123` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new + # + # # Call the get_capacity_commitment method. + # result = client.get_capacity_commitment request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + # p result + # + def get_capacity_commitment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_capacity_commitment.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_capacity_commitment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_capacity_commitment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :get_capacity_commitment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a capacity commitment. Attempting to delete capacity commitment + # before its commitment_end_time will fail with the error code + # `google.rpc.Code.FAILED_PRECONDITION`. + # + # @overload delete_capacity_commitment(request, options = nil) + # Pass arguments to `delete_capacity_commitment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_capacity_commitment(name: nil, force: nil) + # Pass arguments to `delete_capacity_commitment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the capacity commitment to delete. E.g., + # `projects/myproject/locations/US/capacityCommitments/123` + # @param force [::Boolean] + # Can be used to force delete commitments even if assignments exist. Deleting + # commitments with assignments may cause queries to fail if they no longer + # have access to slots. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new + # + # # Call the delete_capacity_commitment method. + # result = client.delete_capacity_commitment request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_capacity_commitment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_capacity_commitment.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_capacity_commitment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_capacity_commitment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :delete_capacity_commitment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an existing capacity commitment. + # + # Only `plan` and `renewal_plan` fields can be updated. + # + # Plan can only be changed to a plan of a longer commitment period. + # Attempting to change to a plan with shorter commitment period will fail + # with the error code `google.rpc.Code.FAILED_PRECONDITION`. + # + # @overload update_capacity_commitment(request, options = nil) + # Pass arguments to `update_capacity_commitment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_capacity_commitment(capacity_commitment: nil, update_mask: nil) + # Pass arguments to `update_capacity_commitment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param capacity_commitment [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment, ::Hash] + # Content of the capacity commitment to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Standard field mask for the set of fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new + # + # # Call the update_capacity_commitment method. + # result = client.update_capacity_commitment request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + # p result + # + def update_capacity_commitment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_capacity_commitment.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::Bigquery::Reservation::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.capacity_commitment&.name + header_params["capacity_commitment.name"] = request.capacity_commitment.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_capacity_commitment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_capacity_commitment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :update_capacity_commitment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Splits capacity commitment to two commitments of the same plan and + # `commitment_end_time`. + # + # A common use case is to enable downgrading commitments. + # + # For example, in order to downgrade from 10000 slots to 8000, you might + # split a 10000 capacity commitment into commitments of 2000 and 8000. Then, + # you delete the first one after the commitment end time passes. + # + # @overload split_capacity_commitment(request, options = nil) + # Pass arguments to `split_capacity_commitment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload split_capacity_commitment(name: nil, slot_count: nil) + # Pass arguments to `split_capacity_commitment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name e.g.,: + # `projects/myproject/locations/US/capacityCommitments/123` + # @param slot_count [::Integer] + # Number of slots in the capacity commitment after the split. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new + # + # # Call the split_capacity_commitment method. + # result = client.split_capacity_commitment request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse. + # p result + # + def split_capacity_commitment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest + + # Converts hash 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.split_capacity_commitment.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.split_capacity_commitment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.split_capacity_commitment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :split_capacity_commitment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Merges capacity commitments of the same plan into a single commitment. + # + # The resulting capacity commitment has the greater commitment_end_time + # out of the to-be-merged capacity commitments. + # + # Attempting to merge capacity commitments of different plan will fail + # with the error code `google.rpc.Code.FAILED_PRECONDITION`. + # + # @overload merge_capacity_commitments(request, options = nil) + # Pass arguments to `merge_capacity_commitments` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload merge_capacity_commitments(parent: nil, capacity_commitment_ids: nil, capacity_commitment_id: nil) + # Pass arguments to `merge_capacity_commitments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Parent resource that identifies admin project and location e.g., + # `projects/myproject/locations/us` + # @param capacity_commitment_ids [::Array<::String>] + # Ids of capacity commitments to merge. + # These capacity commitments must exist under admin project and location + # specified in the parent. + # ID is the last portion of capacity commitment name e.g., 'abc' for + # projects/myproject/locations/US/capacityCommitments/abc + # @param capacity_commitment_id [::String] + # Optional. The optional resulting capacity commitment ID. Capacity + # commitment name will be generated automatically if this field is empty. + # This field must only contain lower case alphanumeric characters or dashes. + # The first and last character cannot be a dash. Max length is 64 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new + # + # # Call the merge_capacity_commitments method. + # result = client.merge_capacity_commitments request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + # p result + # + def merge_capacity_commitments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest + + # Converts hash 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.merge_capacity_commitments.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.merge_capacity_commitments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.merge_capacity_commitments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :merge_capacity_commitments, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an assignment object which allows the given project to submit jobs + # of a certain type using slots from the specified reservation. + # + # Currently a + # resource (project, folder, organization) can only have one assignment per + # each (job_type, location) combination, and that reservation will be used + # for all jobs of the matching type. + # + # Different assignments can be created on different levels of the + # projects, folders or organization hierarchy. During query execution, + # the assignment is looked up at the project, folder and organization levels + # in that order. The first assignment found is applied to the query. + # + # When creating assignments, it does not matter if other assignments exist at + # higher levels. + # + # Example: + # + # * The organization `organizationA` contains two projects, `project1` + # and `project2`. + # * Assignments for all three entities (`organizationA`, `project1`, and + # `project2`) could all be created and mapped to the same or different + # reservations. + # + # "None" assignments represent an absence of the assignment. Projects + # assigned to None use on-demand pricing. To create a "None" assignment, use + # "none" as a reservation_id in the parent. Example parent: + # `projects/myproject/locations/US/reservations/none`. + # + # Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have + # 'bigquery.admin' permissions on the project using the reservation + # and the project that owns this reservation. + # + # Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment + # does not match location of the reservation. + # + # @overload create_assignment(request, options = nil) + # Pass arguments to `create_assignment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_assignment(parent: nil, assignment: nil, assignment_id: nil) + # Pass arguments to `create_assignment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name of the assignment + # E.g. `projects/myproject/locations/US/reservations/team1-prod` + # @param assignment [::Google::Cloud::Bigquery::Reservation::V1::Assignment, ::Hash] + # Assignment resource to create. + # @param assignment_id [::String] + # The optional assignment ID. Assignment name will be generated automatically + # if this field is empty. + # This field must only contain lower case alphanumeric characters or dashes. + # Max length is 64 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new + # + # # Call the create_assignment method. + # result = client.create_assignment request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. + # p result + # + def create_assignment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_assignment.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_assignment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_assignment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :create_assignment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists assignments. + # + # Only explicitly created assignments will be returned. + # + # Example: + # + # * Organization `organizationA` contains two projects, `project1` and + # `project2`. + # * Reservation `res1` exists and was created previously. + # * CreateAssignment was used previously to define the following + # associations between entities and reservations: `` + # and `` + # + # In this example, ListAssignments will just return the above two assignments + # for reservation `res1`, and no expansion/merge will happen. + # + # The wildcard "-" can be used for + # reservations in the request. In that case all assignments belongs to the + # specified project and location will be listed. + # + # **Note** "-" cannot be used for projects nor locations. + # + # @overload list_assignments(request, options = nil) + # Pass arguments to `list_assignments` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_assignments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_assignments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name e.g.: + # + # `projects/myproject/locations/US/reservations/team1-prod` + # + # Or: + # + # `projects/myproject/locations/US/reservations/-` + # @param page_size [::Integer] + # The maximum number of items to return per page. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new + # + # # Call the list_assignments method. + # result = client.list_assignments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. + # p item + # end + # + def list_assignments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_assignments.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_assignments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_assignments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :list_assignments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @reservation_service_stub, :list_assignments, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a assignment. No expansion will happen. + # + # Example: + # + # * Organization `organizationA` contains two projects, `project1` and + # `project2`. + # * Reservation `res1` exists and was created previously. + # * CreateAssignment was used previously to define the following + # associations between entities and reservations: `` + # and `` + # + # In this example, deletion of the `` assignment won't + # affect the other assignment ``. After said deletion, + # queries from `project1` will still use `res1` while queries from + # `project2` will switch to use on-demand mode. + # + # @overload delete_assignment(request, options = nil) + # Pass arguments to `delete_assignment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_assignment(name: nil) + # Pass arguments to `delete_assignment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource, e.g. + # `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new + # + # # Call the delete_assignment method. + # result = client.delete_assignment request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_assignment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_assignment.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_assignment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_assignment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :delete_assignment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deprecated: Looks up assignments for a specified resource for a particular + # region. If the request is about a project: + # + # 1. Assignments created on the project will be returned if they exist. + # 2. Otherwise assignments created on the closest ancestor will be + # returned. + # 3. Assignments for different JobTypes will all be returned. + # + # The same logic applies if the request is about a folder. + # + # If the request is about an organization, then assignments created on the + # organization will be returned (organization doesn't have ancestors). + # + # Comparing to ListAssignments, there are some behavior + # differences: + # + # 1. permission on the assignee will be verified in this API. + # 2. Hierarchy lookup (project->folder->organization) happens in this API. + # 3. Parent here is `projects/*/locations/*`, instead of + # `projects/*/locations/*reservations/*`. + # + # **Note** "-" cannot be used for projects + # nor locations. + # + # @deprecated This method is deprecated and may be removed in the next major version update. + # + # @overload search_assignments(request, options = nil) + # Pass arguments to `search_assignments` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_assignments(parent: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_assignments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the admin project(containing project and + # location), e.g.: + # `projects/myproject/locations/US`. + # @param query [::String] + # Please specify resource name as assignee in the query. + # + # Examples: + # + # * `assignee=projects/myproject` + # * `assignee=folders/123` + # * `assignee=organizations/456` + # @param page_size [::Integer] + # The maximum number of items to return per page. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new + # + # # Call the search_assignments method. + # result = client.search_assignments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. + # p item + # end + # + def search_assignments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest + + # Converts hash 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.search_assignments.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.search_assignments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_assignments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :search_assignments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @reservation_service_stub, :search_assignments, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Looks up assignments for a specified resource for a particular region. + # If the request is about a project: + # + # 1. Assignments created on the project will be returned if they exist. + # 2. Otherwise assignments created on the closest ancestor will be + # returned. + # 3. Assignments for different JobTypes will all be returned. + # + # The same logic applies if the request is about a folder. + # + # If the request is about an organization, then assignments created on the + # organization will be returned (organization doesn't have ancestors). + # + # Comparing to ListAssignments, there are some behavior + # differences: + # + # 1. permission on the assignee will be verified in this API. + # 2. Hierarchy lookup (project->folder->organization) happens in this API. + # 3. Parent here is `projects/*/locations/*`, instead of + # `projects/*/locations/*reservations/*`. + # + # @overload search_all_assignments(request, options = nil) + # Pass arguments to `search_all_assignments` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_all_assignments(parent: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_all_assignments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name with location (project name could be the + # wildcard '-'), e.g.: + # `projects/-/locations/US`. + # @param query [::String] + # Please specify resource name as assignee in the query. + # + # Examples: + # + # * `assignee=projects/myproject` + # * `assignee=folders/123` + # * `assignee=organizations/456` + # @param page_size [::Integer] + # The maximum number of items to return per page. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new + # + # # Call the search_all_assignments method. + # result = client.search_all_assignments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. + # p item + # end + # + def search_all_assignments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest + + # Converts hash 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.search_all_assignments.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.search_all_assignments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_all_assignments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :search_all_assignments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @reservation_service_stub, :search_all_assignments, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Moves an assignment under a new reservation. + # + # This differs from removing an existing assignment and recreating a new one + # by providing a transactional change that ensures an assignee always has an + # associated reservation. + # + # @overload move_assignment(request, options = nil) + # Pass arguments to `move_assignment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload move_assignment(name: nil, destination_id: nil, assignment_id: nil) + # Pass arguments to `move_assignment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the assignment, + # e.g. + # `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + # @param destination_id [::String] + # The new reservation ID, e.g.: + # `projects/myotherproject/locations/US/reservations/team2-prod` + # @param assignment_id [::String] + # The optional assignment ID. A new assignment name is generated if this + # field is empty. + # + # This field can contain only lowercase alphanumeric characters or dashes. + # Max length is 64 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new + # + # # Call the move_assignment method. + # result = client.move_assignment request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. + # p result + # + def move_assignment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.move_assignment.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.move_assignment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.move_assignment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :move_assignment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an existing assignment. + # + # Only the `priority` field can be updated. + # + # @overload update_assignment(request, options = nil) + # Pass arguments to `update_assignment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_assignment(assignment: nil, update_mask: nil) + # Pass arguments to `update_assignment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param assignment [::Google::Cloud::Bigquery::Reservation::V1::Assignment, ::Hash] + # Content of the assignment to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Standard field mask for the set of fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new + # + # # Call the update_assignment method. + # result = client.update_assignment request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. + # p result + # + def update_assignment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_assignment.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::Bigquery::Reservation::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.assignment&.name + header_params["assignment.name"] = request.assignment.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_assignment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_assignment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :update_assignment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a BI reservation. + # + # @overload get_bi_reservation(request, options = nil) + # Pass arguments to `get_bi_reservation` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_bi_reservation(name: nil) + # Pass arguments to `get_bi_reservation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the requested reservation, for example: + # `projects/{project_id}/locations/{location_id}/biReservation` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new + # + # # Call the get_bi_reservation method. + # result = client.get_bi_reservation request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. + # p result + # + def get_bi_reservation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_bi_reservation.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_bi_reservation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_bi_reservation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :get_bi_reservation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a BI reservation. + # + # Only fields specified in the `field_mask` are updated. + # + # A singleton BI reservation always exists with default size 0. + # In order to reserve BI capacity it needs to be updated to an amount + # greater than 0. In order to release BI capacity reservation size + # must be set to 0. + # + # @overload update_bi_reservation(request, options = nil) + # Pass arguments to `update_bi_reservation` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_bi_reservation(bi_reservation: nil, update_mask: nil) + # Pass arguments to `update_bi_reservation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param bi_reservation [::Google::Cloud::Bigquery::Reservation::V1::BiReservation, ::Hash] + # A reservation to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A list of fields to be updated in this request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new + # + # # Call the update_bi_reservation method. + # result = client.update_bi_reservation request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. + # p result + # + def update_bi_reservation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_bi_reservation.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::Bigquery::Reservation::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.bi_reservation&.name + header_params["bi_reservation.name"] = request.bi_reservation.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_bi_reservation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_bi_reservation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :update_bi_reservation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a resource. + # May return: + # + # * A`NOT_FOUND` error if the resource doesn't exist or you don't have the + # permission to view it. + # * An empty policy if the resource exists but doesn't have a set policy. + # + # Supported resources are: + # - Reservations + # - ReservationAssignments + # + # To call this method, you must have the following Google IAM permissions: + # + # - `bigqueryreservation.reservations.getIamPolicy` to get policies on + # reservations. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets an access control policy for a resource. Replaces any existing + # policy. + # + # Supported resources are: + # - Reservations + # + # To call this method, you must have the following Google IAM permissions: + # + # - `bigqueryreservation.reservations.setIamPolicy` to set policies on + # reservations. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets your permissions on a resource. Returns an empty set of permissions if + # the resource doesn't exist. + # + # Supported resources are: + # - Reservations + # + # No Google IAM permissions are required to call this method. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new reservation group. + # + # @overload create_reservation_group(request, options = nil) + # Pass arguments to `create_reservation_group` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_reservation_group(parent: nil, reservation_group_id: nil, reservation_group: nil) + # Pass arguments to `create_reservation_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Project, location. E.g., + # `projects/myproject/locations/US` + # @param reservation_group_id [::String] + # Required. The reservation group ID. It must only contain lower case + # alphanumeric characters or dashes. It must start with a letter and must not + # end with a dash. Its maximum length is 64 characters. + # @param reservation_group [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup, ::Hash] + # Required. New Reservation Group to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest.new + # + # # Call the create_reservation_group method. + # result = client.create_reservation_group request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. + # p result + # + def create_reservation_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_reservation_group.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_reservation_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_reservation_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :create_reservation_group, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns information about the reservation group. + # + # @overload get_reservation_group(request, options = nil) + # Pass arguments to `get_reservation_group` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_reservation_group(name: nil) + # Pass arguments to `get_reservation_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the reservation group to retrieve. E.g., + # `projects/myproject/locations/US/reservationGroups/team1-prod` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest.new + # + # # Call the get_reservation_group method. + # result = client.get_reservation_group request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. + # p result + # + def get_reservation_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_reservation_group.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_reservation_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_reservation_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :get_reservation_group, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a reservation. + # Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + # assignments. + # + # @overload delete_reservation_group(request, options = nil) + # Pass arguments to `delete_reservation_group` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_reservation_group(name: nil) + # Pass arguments to `delete_reservation_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the reservation group to retrieve. E.g., + # `projects/myproject/locations/US/reservationGroups/team1-prod` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest.new + # + # # Call the delete_reservation_group method. + # result = client.delete_reservation_group request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_reservation_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_reservation_group.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_reservation_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_reservation_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :delete_reservation_group, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the reservation groups for the project in the specified location. + # + # @overload list_reservation_groups(request, options = nil) + # Pass arguments to `list_reservation_groups` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_reservation_groups(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_reservation_groups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name containing project and location, e.g.: + # `projects/myproject/locations/US` + # @param page_size [::Integer] + # The maximum number of items to return per page. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest.new + # + # # Call the list_reservation_groups method. + # result = client.list_reservation_groups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. + # p item + # end + # + def list_reservation_groups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_reservation_groups.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::Bigquery::Reservation::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_reservation_groups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_reservation_groups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.call_rpc :list_reservation_groups, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @reservation_service_stub, :list_reservation_groups, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ReservationService API. + # + # This class represents the configuration for ReservationService, + # 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::Bigquery::Reservation::V1::ReservationService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_reservation to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_reservation.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_reservation.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "bigqueryreservation.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ReservationService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_reservation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_reservation + ## + # RPC-specific configuration for `list_reservations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reservations + ## + # RPC-specific configuration for `get_reservation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_reservation + ## + # RPC-specific configuration for `delete_reservation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_reservation + ## + # RPC-specific configuration for `update_reservation` + # @return [::Gapic::Config::Method] + # + attr_reader :update_reservation + ## + # RPC-specific configuration for `failover_reservation` + # @return [::Gapic::Config::Method] + # + attr_reader :failover_reservation + ## + # RPC-specific configuration for `create_capacity_commitment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_capacity_commitment + ## + # RPC-specific configuration for `list_capacity_commitments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_capacity_commitments + ## + # RPC-specific configuration for `get_capacity_commitment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_capacity_commitment + ## + # RPC-specific configuration for `delete_capacity_commitment` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_capacity_commitment + ## + # RPC-specific configuration for `update_capacity_commitment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_capacity_commitment + ## + # RPC-specific configuration for `split_capacity_commitment` + # @return [::Gapic::Config::Method] + # + attr_reader :split_capacity_commitment + ## + # RPC-specific configuration for `merge_capacity_commitments` + # @return [::Gapic::Config::Method] + # + attr_reader :merge_capacity_commitments + ## + # RPC-specific configuration for `create_assignment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_assignment + ## + # RPC-specific configuration for `list_assignments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_assignments + ## + # RPC-specific configuration for `delete_assignment` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_assignment + ## + # RPC-specific configuration for `search_assignments` + # @return [::Gapic::Config::Method] + # + attr_reader :search_assignments + ## + # RPC-specific configuration for `search_all_assignments` + # @return [::Gapic::Config::Method] + # + attr_reader :search_all_assignments + ## + # RPC-specific configuration for `move_assignment` + # @return [::Gapic::Config::Method] + # + attr_reader :move_assignment + ## + # RPC-specific configuration for `update_assignment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_assignment + ## + # RPC-specific configuration for `get_bi_reservation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_bi_reservation + ## + # RPC-specific configuration for `update_bi_reservation` + # @return [::Gapic::Config::Method] + # + attr_reader :update_bi_reservation + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `create_reservation_group` + # @return [::Gapic::Config::Method] + # + attr_reader :create_reservation_group + ## + # RPC-specific configuration for `get_reservation_group` + # @return [::Gapic::Config::Method] + # + attr_reader :get_reservation_group + ## + # RPC-specific configuration for `delete_reservation_group` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_reservation_group + ## + # RPC-specific configuration for `list_reservation_groups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reservation_groups + + # @private + def initialize parent_rpcs = nil + create_reservation_config = parent_rpcs.create_reservation if parent_rpcs.respond_to? :create_reservation + @create_reservation = ::Gapic::Config::Method.new create_reservation_config + list_reservations_config = parent_rpcs.list_reservations if parent_rpcs.respond_to? :list_reservations + @list_reservations = ::Gapic::Config::Method.new list_reservations_config + get_reservation_config = parent_rpcs.get_reservation if parent_rpcs.respond_to? :get_reservation + @get_reservation = ::Gapic::Config::Method.new get_reservation_config + delete_reservation_config = parent_rpcs.delete_reservation if parent_rpcs.respond_to? :delete_reservation + @delete_reservation = ::Gapic::Config::Method.new delete_reservation_config + update_reservation_config = parent_rpcs.update_reservation if parent_rpcs.respond_to? :update_reservation + @update_reservation = ::Gapic::Config::Method.new update_reservation_config + failover_reservation_config = parent_rpcs.failover_reservation if parent_rpcs.respond_to? :failover_reservation + @failover_reservation = ::Gapic::Config::Method.new failover_reservation_config + create_capacity_commitment_config = parent_rpcs.create_capacity_commitment if parent_rpcs.respond_to? :create_capacity_commitment + @create_capacity_commitment = ::Gapic::Config::Method.new create_capacity_commitment_config + list_capacity_commitments_config = parent_rpcs.list_capacity_commitments if parent_rpcs.respond_to? :list_capacity_commitments + @list_capacity_commitments = ::Gapic::Config::Method.new list_capacity_commitments_config + get_capacity_commitment_config = parent_rpcs.get_capacity_commitment if parent_rpcs.respond_to? :get_capacity_commitment + @get_capacity_commitment = ::Gapic::Config::Method.new get_capacity_commitment_config + delete_capacity_commitment_config = parent_rpcs.delete_capacity_commitment if parent_rpcs.respond_to? :delete_capacity_commitment + @delete_capacity_commitment = ::Gapic::Config::Method.new delete_capacity_commitment_config + update_capacity_commitment_config = parent_rpcs.update_capacity_commitment if parent_rpcs.respond_to? :update_capacity_commitment + @update_capacity_commitment = ::Gapic::Config::Method.new update_capacity_commitment_config + split_capacity_commitment_config = parent_rpcs.split_capacity_commitment if parent_rpcs.respond_to? :split_capacity_commitment + @split_capacity_commitment = ::Gapic::Config::Method.new split_capacity_commitment_config + merge_capacity_commitments_config = parent_rpcs.merge_capacity_commitments if parent_rpcs.respond_to? :merge_capacity_commitments + @merge_capacity_commitments = ::Gapic::Config::Method.new merge_capacity_commitments_config + create_assignment_config = parent_rpcs.create_assignment if parent_rpcs.respond_to? :create_assignment + @create_assignment = ::Gapic::Config::Method.new create_assignment_config + list_assignments_config = parent_rpcs.list_assignments if parent_rpcs.respond_to? :list_assignments + @list_assignments = ::Gapic::Config::Method.new list_assignments_config + delete_assignment_config = parent_rpcs.delete_assignment if parent_rpcs.respond_to? :delete_assignment + @delete_assignment = ::Gapic::Config::Method.new delete_assignment_config + search_assignments_config = parent_rpcs.search_assignments if parent_rpcs.respond_to? :search_assignments + @search_assignments = ::Gapic::Config::Method.new search_assignments_config + search_all_assignments_config = parent_rpcs.search_all_assignments if parent_rpcs.respond_to? :search_all_assignments + @search_all_assignments = ::Gapic::Config::Method.new search_all_assignments_config + move_assignment_config = parent_rpcs.move_assignment if parent_rpcs.respond_to? :move_assignment + @move_assignment = ::Gapic::Config::Method.new move_assignment_config + update_assignment_config = parent_rpcs.update_assignment if parent_rpcs.respond_to? :update_assignment + @update_assignment = ::Gapic::Config::Method.new update_assignment_config + get_bi_reservation_config = parent_rpcs.get_bi_reservation if parent_rpcs.respond_to? :get_bi_reservation + @get_bi_reservation = ::Gapic::Config::Method.new get_bi_reservation_config + update_bi_reservation_config = parent_rpcs.update_bi_reservation if parent_rpcs.respond_to? :update_bi_reservation + @update_bi_reservation = ::Gapic::Config::Method.new update_bi_reservation_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + create_reservation_group_config = parent_rpcs.create_reservation_group if parent_rpcs.respond_to? :create_reservation_group + @create_reservation_group = ::Gapic::Config::Method.new create_reservation_group_config + get_reservation_group_config = parent_rpcs.get_reservation_group if parent_rpcs.respond_to? :get_reservation_group + @get_reservation_group = ::Gapic::Config::Method.new get_reservation_group_config + delete_reservation_group_config = parent_rpcs.delete_reservation_group if parent_rpcs.respond_to? :delete_reservation_group + @delete_reservation_group = ::Gapic::Config::Method.new delete_reservation_group_config + list_reservation_groups_config = parent_rpcs.list_reservation_groups if parent_rpcs.respond_to? :list_reservation_groups + @list_reservation_groups = ::Gapic::Config::Method.new list_reservation_groups_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/credentials.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/credentials.rb new file mode 100644 index 000000000000..a5d4a895f5bb --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/credentials.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Bigquery + module Reservation + module V1 + module ReservationService + # Credentials for the ReservationService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "BIGQUERY_RESERVATION_CREDENTIALS", + "BIGQUERY_RESERVATION_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "BIGQUERY_RESERVATION_CREDENTIALS_JSON", + "BIGQUERY_RESERVATION_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/paths.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/paths.rb new file mode 100644 index 000000000000..3b899d027983 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/paths.rb @@ -0,0 +1,147 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Bigquery + module Reservation + module V1 + module ReservationService + # Path helper methods for the ReservationService API. + module Paths + ## + # Create a fully-qualified Assignment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}` + # + # @param project [String] + # @param location [String] + # @param reservation [String] + # @param assignment [String] + # + # @return [::String] + def assignment_path project:, location:, reservation:, assignment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "reservation cannot contain /" if reservation.to_s.include? "/" + + "projects/#{project}/locations/#{location}/reservations/#{reservation}/assignments/#{assignment}" + end + + ## + # Create a fully-qualified BiReservation resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/biReservation` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def bi_reservation_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/biReservation" + end + + ## + # Create a fully-qualified CapacityCommitment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}` + # + # @param project [String] + # @param location [String] + # @param capacity_commitment [String] + # + # @return [::String] + def capacity_commitment_path project:, location:, capacity_commitment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/capacityCommitments/#{capacity_commitment}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Reservation resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/reservations/{reservation}` + # + # @param project [String] + # @param location [String] + # @param reservation [String] + # + # @return [::String] + def reservation_path project:, location:, reservation: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/reservations/#{reservation}" + end + + ## + # Create a fully-qualified ReservationGroup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/reservationGroups/{reservation_group}` + # + # @param project [String] + # @param location [String] + # @param reservation_group [String] + # + # @return [::String] + def reservation_group_path project:, location:, reservation_group: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/reservationGroups/#{reservation_group}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest.rb new file mode 100644 index 000000000000..a91126179e23 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/bigquery/reservation/v1/version" + +require "google/cloud/bigquery/reservation/v1/reservation_service/credentials" +require "google/cloud/bigquery/reservation/v1/reservation_service/paths" +require "google/cloud/bigquery/reservation/v1/reservation_service/rest/client" + +module Google + module Cloud + module Bigquery + module Reservation + module V1 + ## + # This API allows users to manage their BigQuery reservations. + # + # A reservation provides computational resource guarantees, in the form of + # [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a + # unit of computational power in BigQuery, and serves as the basic unit of + # parallelism. In a scan of a multi-partitioned table, a single slot operates + # on a single partition of the table. A reservation resource exists as a child + # resource of the admin project and location, e.g.: + # `projects/myproject/locations/US/reservations/reservationName`. + # + # A capacity commitment is a way to purchase compute capacity for BigQuery jobs + # (in the form of slots) with some committed period of usage. A capacity + # commitment resource exists as a child resource of the admin project and + # location, e.g.: + # `projects/myproject/locations/US/capacityCommitments/id`. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/bigquery/reservation/v1/reservation_service/rest" + # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + module ReservationService + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/bigquery/reservation/v1/reservation_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb new file mode 100644 index 000000000000..89cf0fa7cae2 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb @@ -0,0 +1,3266 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/bigquery/reservation/v1/reservation_pb" +require "google/cloud/bigquery/reservation/v1/reservation_service/rest/service_stub" + +module Google + module Cloud + module Bigquery + module Reservation + module V1 + module ReservationService + module Rest + ## + # REST client for the ReservationService service. + # + # This API allows users to manage their BigQuery reservations. + # + # A reservation provides computational resource guarantees, in the form of + # [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a + # unit of computational power in BigQuery, and serves as the basic unit of + # parallelism. In a scan of a multi-partitioned table, a single slot operates + # on a single partition of the table. A reservation resource exists as a child + # resource of the admin project and location, e.g.: + # `projects/myproject/locations/US/reservations/reservationName`. + # + # A capacity commitment is a way to purchase compute capacity for BigQuery jobs + # (in the form of slots) with some committed period of usage. A capacity + # commitment resource exists as a child resource of the admin project and + # location, e.g.: + # `projects/myproject/locations/US/capacityCommitments/id`. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "bigqueryreservation.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :reservation_service_stub + + ## + # Configure the ReservationService Client class. + # + # See {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ReservationService clients + # ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::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", "Bigquery", "Reservation", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_reservation.timeout = 300.0 + + default_config.rpcs.list_reservations.timeout = 300.0 + default_config.rpcs.list_reservations.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_reservation.timeout = 300.0 + default_config.rpcs.get_reservation.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.delete_reservation.timeout = 300.0 + default_config.rpcs.delete_reservation.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_reservation.timeout = 300.0 + + default_config.rpcs.failover_reservation.timeout = 300.0 + + default_config.rpcs.create_capacity_commitment.timeout = 300.0 + + default_config.rpcs.list_capacity_commitments.timeout = 300.0 + default_config.rpcs.list_capacity_commitments.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_capacity_commitment.timeout = 300.0 + default_config.rpcs.get_capacity_commitment.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.delete_capacity_commitment.timeout = 300.0 + default_config.rpcs.delete_capacity_commitment.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_capacity_commitment.timeout = 300.0 + + default_config.rpcs.split_capacity_commitment.timeout = 300.0 + + default_config.rpcs.merge_capacity_commitments.timeout = 300.0 + + default_config.rpcs.create_assignment.timeout = 300.0 + + default_config.rpcs.list_assignments.timeout = 300.0 + default_config.rpcs.list_assignments.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.delete_assignment.timeout = 300.0 + default_config.rpcs.delete_assignment.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_assignments.timeout = 300.0 + default_config.rpcs.search_assignments.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.move_assignment.timeout = 300.0 + + default_config.rpcs.get_bi_reservation.timeout = 300.0 + default_config.rpcs.get_bi_reservation.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_bi_reservation.timeout = 300.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ReservationService 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::Bigquery::Reservation::V1::ReservationService::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 + @reservation_service_stub.universe_domain + end + + ## + # Create a new ReservationService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ReservationService 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 + + @reservation_service_stub = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @reservation_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @reservation_service_stub.logger + end + + # Service calls + + ## + # Creates a new reservation resource. + # + # @overload create_reservation(request, options = nil) + # Pass arguments to `create_reservation` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_reservation(parent: nil, reservation_id: nil, reservation: nil) + # Pass arguments to `create_reservation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Project, location. E.g., + # `projects/myproject/locations/US` + # @param reservation_id [::String] + # The reservation ID. It must only contain lower case alphanumeric + # characters or dashes. It must start with a letter and must not end + # with a dash. Its maximum length is 64 characters. + # @param reservation [::Google::Cloud::Bigquery::Reservation::V1::Reservation, ::Hash] + # Definition of the new reservation to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new + # + # # Call the create_reservation method. + # result = client.create_reservation request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. + # p result + # + def create_reservation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_reservation.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_reservation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_reservation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.create_reservation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the reservations for the project in the specified location. + # + # @overload list_reservations(request, options = nil) + # Pass arguments to `list_reservations` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_reservations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_reservations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name containing project and location, e.g.: + # `projects/myproject/locations/US` + # @param page_size [::Integer] + # The maximum number of items to return per page. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Reservation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Reservation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new + # + # # Call the list_reservations method. + # result = client.list_reservations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Reservation. + # p item + # end + # + def list_reservations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_reservations.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_reservations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_reservations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.list_reservations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :list_reservations, "reservations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns information about the reservation. + # + # @overload get_reservation(request, options = nil) + # Pass arguments to `get_reservation` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_reservation(name: nil) + # Pass arguments to `get_reservation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the reservation to retrieve. E.g., + # `projects/myproject/locations/US/reservations/team1-prod` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new + # + # # Call the get_reservation method. + # result = client.get_reservation request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. + # p result + # + def get_reservation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_reservation.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_reservation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_reservation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.get_reservation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a reservation. + # Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + # assignments. + # + # @overload delete_reservation(request, options = nil) + # Pass arguments to `delete_reservation` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_reservation(name: nil) + # Pass arguments to `delete_reservation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the reservation to retrieve. E.g., + # `projects/myproject/locations/US/reservations/team1-prod` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new + # + # # Call the delete_reservation method. + # result = client.delete_reservation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_reservation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_reservation.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_reservation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_reservation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.delete_reservation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an existing reservation resource. + # + # @overload update_reservation(request, options = nil) + # Pass arguments to `update_reservation` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_reservation(reservation: nil, update_mask: nil) + # Pass arguments to `update_reservation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param reservation [::Google::Cloud::Bigquery::Reservation::V1::Reservation, ::Hash] + # Content of the reservation to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Standard field mask for the set of fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new + # + # # Call the update_reservation method. + # result = client.update_reservation request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. + # p result + # + def update_reservation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_reservation.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_reservation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_reservation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.update_reservation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Fail over a reservation to the secondary location. The operation should be + # done in the current secondary location, which will be promoted to the + # new primary location for the reservation. + # Attempting to failover a reservation in the current primary location will + # fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + # + # @overload failover_reservation(request, options = nil) + # Pass arguments to `failover_reservation` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload failover_reservation(name: nil, failover_mode: nil) + # Pass arguments to `failover_reservation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the reservation to failover. E.g., + # `projects/myproject/locations/US/reservations/team1-prod` + # @param failover_mode [::Google::Cloud::Bigquery::Reservation::V1::FailoverMode] + # Optional. A parameter that determines how writes that are pending + # replication are handled after a failover is initiated. If not specified, + # HARD failover mode is used by default. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest.new + # + # # Call the failover_reservation method. + # result = client.failover_reservation request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. + # p result + # + def failover_reservation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest + + # Converts hash 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.failover_reservation.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::Bigquery::Reservation::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.failover_reservation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.failover_reservation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.failover_reservation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new capacity commitment resource. + # + # @overload create_capacity_commitment(request, options = nil) + # Pass arguments to `create_capacity_commitment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_capacity_commitment(parent: nil, capacity_commitment: nil, enforce_single_admin_project_per_org: nil, capacity_commitment_id: nil) + # Pass arguments to `create_capacity_commitment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the parent reservation. E.g., + # `projects/myproject/locations/US` + # @param capacity_commitment [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment, ::Hash] + # Content of the capacity commitment to create. + # @param enforce_single_admin_project_per_org [::Boolean] + # If true, fail the request if another project in the organization has a + # capacity commitment. + # @param capacity_commitment_id [::String] + # The optional capacity commitment ID. Capacity commitment name will be + # generated automatically if this field is empty. + # This field must only contain lower case alphanumeric characters or dashes. + # The first and last character cannot be a dash. Max length is 64 characters. + # NOTE: this ID won't be kept if the capacity commitment is split or merged. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new + # + # # Call the create_capacity_commitment method. + # result = client.create_capacity_commitment request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + # p result + # + def create_capacity_commitment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_capacity_commitment.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_capacity_commitment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_capacity_commitment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.create_capacity_commitment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the capacity commitments for the admin project. + # + # @overload list_capacity_commitments(request, options = nil) + # Pass arguments to `list_capacity_commitments` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_capacity_commitments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_capacity_commitments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the parent reservation. E.g., + # `projects/myproject/locations/US` + # @param page_size [::Integer] + # The maximum number of items to return. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new + # + # # Call the list_capacity_commitments method. + # result = client.list_capacity_commitments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + # p item + # end + # + def list_capacity_commitments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_capacity_commitments.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_capacity_commitments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_capacity_commitments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.list_capacity_commitments request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :list_capacity_commitments, "capacity_commitments", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns information about the capacity commitment. + # + # @overload get_capacity_commitment(request, options = nil) + # Pass arguments to `get_capacity_commitment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_capacity_commitment(name: nil) + # Pass arguments to `get_capacity_commitment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the capacity commitment to retrieve. E.g., + # `projects/myproject/locations/US/capacityCommitments/123` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new + # + # # Call the get_capacity_commitment method. + # result = client.get_capacity_commitment request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + # p result + # + def get_capacity_commitment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_capacity_commitment.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_capacity_commitment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_capacity_commitment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.get_capacity_commitment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a capacity commitment. Attempting to delete capacity commitment + # before its commitment_end_time will fail with the error code + # `google.rpc.Code.FAILED_PRECONDITION`. + # + # @overload delete_capacity_commitment(request, options = nil) + # Pass arguments to `delete_capacity_commitment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_capacity_commitment(name: nil, force: nil) + # Pass arguments to `delete_capacity_commitment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the capacity commitment to delete. E.g., + # `projects/myproject/locations/US/capacityCommitments/123` + # @param force [::Boolean] + # Can be used to force delete commitments even if assignments exist. Deleting + # commitments with assignments may cause queries to fail if they no longer + # have access to slots. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new + # + # # Call the delete_capacity_commitment method. + # result = client.delete_capacity_commitment request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_capacity_commitment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_capacity_commitment.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_capacity_commitment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_capacity_commitment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.delete_capacity_commitment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an existing capacity commitment. + # + # Only `plan` and `renewal_plan` fields can be updated. + # + # Plan can only be changed to a plan of a longer commitment period. + # Attempting to change to a plan with shorter commitment period will fail + # with the error code `google.rpc.Code.FAILED_PRECONDITION`. + # + # @overload update_capacity_commitment(request, options = nil) + # Pass arguments to `update_capacity_commitment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_capacity_commitment(capacity_commitment: nil, update_mask: nil) + # Pass arguments to `update_capacity_commitment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param capacity_commitment [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment, ::Hash] + # Content of the capacity commitment to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Standard field mask for the set of fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new + # + # # Call the update_capacity_commitment method. + # result = client.update_capacity_commitment request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + # p result + # + def update_capacity_commitment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_capacity_commitment.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_capacity_commitment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_capacity_commitment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.update_capacity_commitment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Splits capacity commitment to two commitments of the same plan and + # `commitment_end_time`. + # + # A common use case is to enable downgrading commitments. + # + # For example, in order to downgrade from 10000 slots to 8000, you might + # split a 10000 capacity commitment into commitments of 2000 and 8000. Then, + # you delete the first one after the commitment end time passes. + # + # @overload split_capacity_commitment(request, options = nil) + # Pass arguments to `split_capacity_commitment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload split_capacity_commitment(name: nil, slot_count: nil) + # Pass arguments to `split_capacity_commitment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name e.g.,: + # `projects/myproject/locations/US/capacityCommitments/123` + # @param slot_count [::Integer] + # Number of slots in the capacity commitment after the split. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new + # + # # Call the split_capacity_commitment method. + # result = client.split_capacity_commitment request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse. + # p result + # + def split_capacity_commitment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest + + # Converts hash 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.split_capacity_commitment.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::Bigquery::Reservation::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.split_capacity_commitment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.split_capacity_commitment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.split_capacity_commitment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Merges capacity commitments of the same plan into a single commitment. + # + # The resulting capacity commitment has the greater commitment_end_time + # out of the to-be-merged capacity commitments. + # + # Attempting to merge capacity commitments of different plan will fail + # with the error code `google.rpc.Code.FAILED_PRECONDITION`. + # + # @overload merge_capacity_commitments(request, options = nil) + # Pass arguments to `merge_capacity_commitments` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload merge_capacity_commitments(parent: nil, capacity_commitment_ids: nil, capacity_commitment_id: nil) + # Pass arguments to `merge_capacity_commitments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Parent resource that identifies admin project and location e.g., + # `projects/myproject/locations/us` + # @param capacity_commitment_ids [::Array<::String>] + # Ids of capacity commitments to merge. + # These capacity commitments must exist under admin project and location + # specified in the parent. + # ID is the last portion of capacity commitment name e.g., 'abc' for + # projects/myproject/locations/US/capacityCommitments/abc + # @param capacity_commitment_id [::String] + # Optional. The optional resulting capacity commitment ID. Capacity + # commitment name will be generated automatically if this field is empty. + # This field must only contain lower case alphanumeric characters or dashes. + # The first and last character cannot be a dash. Max length is 64 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new + # + # # Call the merge_capacity_commitments method. + # result = client.merge_capacity_commitments request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + # p result + # + def merge_capacity_commitments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest + + # Converts hash 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.merge_capacity_commitments.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::Bigquery::Reservation::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.merge_capacity_commitments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.merge_capacity_commitments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.merge_capacity_commitments request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an assignment object which allows the given project to submit jobs + # of a certain type using slots from the specified reservation. + # + # Currently a + # resource (project, folder, organization) can only have one assignment per + # each (job_type, location) combination, and that reservation will be used + # for all jobs of the matching type. + # + # Different assignments can be created on different levels of the + # projects, folders or organization hierarchy. During query execution, + # the assignment is looked up at the project, folder and organization levels + # in that order. The first assignment found is applied to the query. + # + # When creating assignments, it does not matter if other assignments exist at + # higher levels. + # + # Example: + # + # * The organization `organizationA` contains two projects, `project1` + # and `project2`. + # * Assignments for all three entities (`organizationA`, `project1`, and + # `project2`) could all be created and mapped to the same or different + # reservations. + # + # "None" assignments represent an absence of the assignment. Projects + # assigned to None use on-demand pricing. To create a "None" assignment, use + # "none" as a reservation_id in the parent. Example parent: + # `projects/myproject/locations/US/reservations/none`. + # + # Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have + # 'bigquery.admin' permissions on the project using the reservation + # and the project that owns this reservation. + # + # Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment + # does not match location of the reservation. + # + # @overload create_assignment(request, options = nil) + # Pass arguments to `create_assignment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_assignment(parent: nil, assignment: nil, assignment_id: nil) + # Pass arguments to `create_assignment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name of the assignment + # E.g. `projects/myproject/locations/US/reservations/team1-prod` + # @param assignment [::Google::Cloud::Bigquery::Reservation::V1::Assignment, ::Hash] + # Assignment resource to create. + # @param assignment_id [::String] + # The optional assignment ID. Assignment name will be generated automatically + # if this field is empty. + # This field must only contain lower case alphanumeric characters or dashes. + # Max length is 64 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new + # + # # Call the create_assignment method. + # result = client.create_assignment request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. + # p result + # + def create_assignment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_assignment.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_assignment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_assignment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.create_assignment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists assignments. + # + # Only explicitly created assignments will be returned. + # + # Example: + # + # * Organization `organizationA` contains two projects, `project1` and + # `project2`. + # * Reservation `res1` exists and was created previously. + # * CreateAssignment was used previously to define the following + # associations between entities and reservations: `` + # and `` + # + # In this example, ListAssignments will just return the above two assignments + # for reservation `res1`, and no expansion/merge will happen. + # + # The wildcard "-" can be used for + # reservations in the request. In that case all assignments belongs to the + # specified project and location will be listed. + # + # **Note** "-" cannot be used for projects nor locations. + # + # @overload list_assignments(request, options = nil) + # Pass arguments to `list_assignments` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_assignments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_assignments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name e.g.: + # + # `projects/myproject/locations/US/reservations/team1-prod` + # + # Or: + # + # `projects/myproject/locations/US/reservations/-` + # @param page_size [::Integer] + # The maximum number of items to return per page. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new + # + # # Call the list_assignments method. + # result = client.list_assignments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. + # p item + # end + # + def list_assignments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_assignments.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_assignments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_assignments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.list_assignments request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :list_assignments, "assignments", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a assignment. No expansion will happen. + # + # Example: + # + # * Organization `organizationA` contains two projects, `project1` and + # `project2`. + # * Reservation `res1` exists and was created previously. + # * CreateAssignment was used previously to define the following + # associations between entities and reservations: `` + # and `` + # + # In this example, deletion of the `` assignment won't + # affect the other assignment ``. After said deletion, + # queries from `project1` will still use `res1` while queries from + # `project2` will switch to use on-demand mode. + # + # @overload delete_assignment(request, options = nil) + # Pass arguments to `delete_assignment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_assignment(name: nil) + # Pass arguments to `delete_assignment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the resource, e.g. + # `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new + # + # # Call the delete_assignment method. + # result = client.delete_assignment request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_assignment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_assignment.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_assignment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_assignment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.delete_assignment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deprecated: Looks up assignments for a specified resource for a particular + # region. If the request is about a project: + # + # 1. Assignments created on the project will be returned if they exist. + # 2. Otherwise assignments created on the closest ancestor will be + # returned. + # 3. Assignments for different JobTypes will all be returned. + # + # The same logic applies if the request is about a folder. + # + # If the request is about an organization, then assignments created on the + # organization will be returned (organization doesn't have ancestors). + # + # Comparing to ListAssignments, there are some behavior + # differences: + # + # 1. permission on the assignee will be verified in this API. + # 2. Hierarchy lookup (project->folder->organization) happens in this API. + # 3. Parent here is `projects/*/locations/*`, instead of + # `projects/*/locations/*reservations/*`. + # + # **Note** "-" cannot be used for projects + # nor locations. + # + # @overload search_assignments(request, options = nil) + # Pass arguments to `search_assignments` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_assignments(parent: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_assignments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the admin project(containing project and + # location), e.g.: + # `projects/myproject/locations/US`. + # @param query [::String] + # Please specify resource name as assignee in the query. + # + # Examples: + # + # * `assignee=projects/myproject` + # * `assignee=folders/123` + # * `assignee=organizations/456` + # @param page_size [::Integer] + # The maximum number of items to return per page. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new + # + # # Call the search_assignments method. + # result = client.search_assignments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. + # p item + # end + # + def search_assignments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest + + # Converts hash 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.search_assignments.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::Bigquery::Reservation::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.search_assignments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_assignments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.search_assignments request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :search_assignments, "assignments", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Looks up assignments for a specified resource for a particular region. + # If the request is about a project: + # + # 1. Assignments created on the project will be returned if they exist. + # 2. Otherwise assignments created on the closest ancestor will be + # returned. + # 3. Assignments for different JobTypes will all be returned. + # + # The same logic applies if the request is about a folder. + # + # If the request is about an organization, then assignments created on the + # organization will be returned (organization doesn't have ancestors). + # + # Comparing to ListAssignments, there are some behavior + # differences: + # + # 1. permission on the assignee will be verified in this API. + # 2. Hierarchy lookup (project->folder->organization) happens in this API. + # 3. Parent here is `projects/*/locations/*`, instead of + # `projects/*/locations/*reservations/*`. + # + # @overload search_all_assignments(request, options = nil) + # Pass arguments to `search_all_assignments` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_all_assignments(parent: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_all_assignments` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name with location (project name could be the + # wildcard '-'), e.g.: + # `projects/-/locations/US`. + # @param query [::String] + # Please specify resource name as assignee in the query. + # + # Examples: + # + # * `assignee=projects/myproject` + # * `assignee=folders/123` + # * `assignee=organizations/456` + # @param page_size [::Integer] + # The maximum number of items to return per page. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new + # + # # Call the search_all_assignments method. + # result = client.search_all_assignments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. + # p item + # end + # + def search_all_assignments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest + + # Converts hash 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.search_all_assignments.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::Bigquery::Reservation::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.search_all_assignments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_all_assignments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.search_all_assignments request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :search_all_assignments, "assignments", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Moves an assignment under a new reservation. + # + # This differs from removing an existing assignment and recreating a new one + # by providing a transactional change that ensures an assignee always has an + # associated reservation. + # + # @overload move_assignment(request, options = nil) + # Pass arguments to `move_assignment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload move_assignment(name: nil, destination_id: nil, assignment_id: nil) + # Pass arguments to `move_assignment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the assignment, + # e.g. + # `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + # @param destination_id [::String] + # The new reservation ID, e.g.: + # `projects/myotherproject/locations/US/reservations/team2-prod` + # @param assignment_id [::String] + # The optional assignment ID. A new assignment name is generated if this + # field is empty. + # + # This field can contain only lowercase alphanumeric characters or dashes. + # Max length is 64 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new + # + # # Call the move_assignment method. + # result = client.move_assignment request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. + # p result + # + def move_assignment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.move_assignment.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.move_assignment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.move_assignment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.move_assignment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an existing assignment. + # + # Only the `priority` field can be updated. + # + # @overload update_assignment(request, options = nil) + # Pass arguments to `update_assignment` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_assignment(assignment: nil, update_mask: nil) + # Pass arguments to `update_assignment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param assignment [::Google::Cloud::Bigquery::Reservation::V1::Assignment, ::Hash] + # Content of the assignment to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Standard field mask for the set of fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new + # + # # Call the update_assignment method. + # result = client.update_assignment request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. + # p result + # + def update_assignment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_assignment.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_assignment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_assignment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.update_assignment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a BI reservation. + # + # @overload get_bi_reservation(request, options = nil) + # Pass arguments to `get_bi_reservation` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_bi_reservation(name: nil) + # Pass arguments to `get_bi_reservation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the requested reservation, for example: + # `projects/{project_id}/locations/{location_id}/biReservation` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new + # + # # Call the get_bi_reservation method. + # result = client.get_bi_reservation request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. + # p result + # + def get_bi_reservation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_bi_reservation.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_bi_reservation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_bi_reservation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.get_bi_reservation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a BI reservation. + # + # Only fields specified in the `field_mask` are updated. + # + # A singleton BI reservation always exists with default size 0. + # In order to reserve BI capacity it needs to be updated to an amount + # greater than 0. In order to release BI capacity reservation size + # must be set to 0. + # + # @overload update_bi_reservation(request, options = nil) + # Pass arguments to `update_bi_reservation` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_bi_reservation(bi_reservation: nil, update_mask: nil) + # Pass arguments to `update_bi_reservation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param bi_reservation [::Google::Cloud::Bigquery::Reservation::V1::BiReservation, ::Hash] + # A reservation to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A list of fields to be updated in this request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new + # + # # Call the update_bi_reservation method. + # result = client.update_bi_reservation request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. + # p result + # + def update_bi_reservation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_bi_reservation.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_bi_reservation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_bi_reservation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.update_bi_reservation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a resource. + # May return: + # + # * A`NOT_FOUND` error if the resource doesn't exist or you don't have the + # permission to view it. + # * An empty policy if the resource exists but doesn't have a set policy. + # + # Supported resources are: + # - Reservations + # - ReservationAssignments + # + # To call this method, you must have the following Google IAM permissions: + # + # - `bigqueryreservation.reservations.getIamPolicy` to get policies on + # reservations. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets an access control policy for a resource. Replaces any existing + # policy. + # + # Supported resources are: + # - Reservations + # + # To call this method, you must have the following Google IAM permissions: + # + # - `bigqueryreservation.reservations.setIamPolicy` to set policies on + # reservations. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets your permissions on a resource. Returns an empty set of permissions if + # the resource doesn't exist. + # + # Supported resources are: + # - Reservations + # + # No Google IAM permissions are required to call this method. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new reservation group. + # + # @overload create_reservation_group(request, options = nil) + # Pass arguments to `create_reservation_group` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_reservation_group(parent: nil, reservation_group_id: nil, reservation_group: nil) + # Pass arguments to `create_reservation_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Project, location. E.g., + # `projects/myproject/locations/US` + # @param reservation_group_id [::String] + # Required. The reservation group ID. It must only contain lower case + # alphanumeric characters or dashes. It must start with a letter and must not + # end with a dash. Its maximum length is 64 characters. + # @param reservation_group [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup, ::Hash] + # Required. New Reservation Group to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest.new + # + # # Call the create_reservation_group method. + # result = client.create_reservation_group request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. + # p result + # + def create_reservation_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_reservation_group.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_reservation_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_reservation_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.create_reservation_group request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns information about the reservation group. + # + # @overload get_reservation_group(request, options = nil) + # Pass arguments to `get_reservation_group` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_reservation_group(name: nil) + # Pass arguments to `get_reservation_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the reservation group to retrieve. E.g., + # `projects/myproject/locations/US/reservationGroups/team1-prod` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest.new + # + # # Call the get_reservation_group method. + # result = client.get_reservation_group request + # + # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. + # p result + # + def get_reservation_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_reservation_group.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_reservation_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_reservation_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.get_reservation_group request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a reservation. + # Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + # assignments. + # + # @overload delete_reservation_group(request, options = nil) + # Pass arguments to `delete_reservation_group` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_reservation_group(name: nil) + # Pass arguments to `delete_reservation_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the reservation group to retrieve. E.g., + # `projects/myproject/locations/US/reservationGroups/team1-prod` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest.new + # + # # Call the delete_reservation_group method. + # result = client.delete_reservation_group request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_reservation_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_reservation_group.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_reservation_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_reservation_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.delete_reservation_group request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the reservation groups for the project in the specified location. + # + # @overload list_reservation_groups(request, options = nil) + # Pass arguments to `list_reservation_groups` via a request object, either of type + # {::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_reservation_groups(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_reservation_groups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name containing project and location, e.g.: + # `projects/myproject/locations/US` + # @param page_size [::Integer] + # The maximum number of items to return per page. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/bigquery/reservation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest.new + # + # # Call the list_reservation_groups method. + # result = client.list_reservation_groups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. + # p item + # end + # + def list_reservation_groups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_reservation_groups.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::Bigquery::Reservation::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_reservation_groups.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_reservation_groups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reservation_service_stub.list_reservation_groups request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :list_reservation_groups, "reservation_groups", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ReservationService REST API. + # + # This class represents the configuration for ReservationService 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::Bigquery::Reservation::V1::ReservationService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_reservation to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_reservation.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_reservation.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "bigqueryreservation.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ReservationService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_reservation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_reservation + ## + # RPC-specific configuration for `list_reservations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reservations + ## + # RPC-specific configuration for `get_reservation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_reservation + ## + # RPC-specific configuration for `delete_reservation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_reservation + ## + # RPC-specific configuration for `update_reservation` + # @return [::Gapic::Config::Method] + # + attr_reader :update_reservation + ## + # RPC-specific configuration for `failover_reservation` + # @return [::Gapic::Config::Method] + # + attr_reader :failover_reservation + ## + # RPC-specific configuration for `create_capacity_commitment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_capacity_commitment + ## + # RPC-specific configuration for `list_capacity_commitments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_capacity_commitments + ## + # RPC-specific configuration for `get_capacity_commitment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_capacity_commitment + ## + # RPC-specific configuration for `delete_capacity_commitment` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_capacity_commitment + ## + # RPC-specific configuration for `update_capacity_commitment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_capacity_commitment + ## + # RPC-specific configuration for `split_capacity_commitment` + # @return [::Gapic::Config::Method] + # + attr_reader :split_capacity_commitment + ## + # RPC-specific configuration for `merge_capacity_commitments` + # @return [::Gapic::Config::Method] + # + attr_reader :merge_capacity_commitments + ## + # RPC-specific configuration for `create_assignment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_assignment + ## + # RPC-specific configuration for `list_assignments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_assignments + ## + # RPC-specific configuration for `delete_assignment` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_assignment + ## + # RPC-specific configuration for `search_assignments` + # @return [::Gapic::Config::Method] + # + attr_reader :search_assignments + ## + # RPC-specific configuration for `search_all_assignments` + # @return [::Gapic::Config::Method] + # + attr_reader :search_all_assignments + ## + # RPC-specific configuration for `move_assignment` + # @return [::Gapic::Config::Method] + # + attr_reader :move_assignment + ## + # RPC-specific configuration for `update_assignment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_assignment + ## + # RPC-specific configuration for `get_bi_reservation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_bi_reservation + ## + # RPC-specific configuration for `update_bi_reservation` + # @return [::Gapic::Config::Method] + # + attr_reader :update_bi_reservation + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `create_reservation_group` + # @return [::Gapic::Config::Method] + # + attr_reader :create_reservation_group + ## + # RPC-specific configuration for `get_reservation_group` + # @return [::Gapic::Config::Method] + # + attr_reader :get_reservation_group + ## + # RPC-specific configuration for `delete_reservation_group` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_reservation_group + ## + # RPC-specific configuration for `list_reservation_groups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reservation_groups + + # @private + def initialize parent_rpcs = nil + create_reservation_config = parent_rpcs.create_reservation if parent_rpcs.respond_to? :create_reservation + @create_reservation = ::Gapic::Config::Method.new create_reservation_config + list_reservations_config = parent_rpcs.list_reservations if parent_rpcs.respond_to? :list_reservations + @list_reservations = ::Gapic::Config::Method.new list_reservations_config + get_reservation_config = parent_rpcs.get_reservation if parent_rpcs.respond_to? :get_reservation + @get_reservation = ::Gapic::Config::Method.new get_reservation_config + delete_reservation_config = parent_rpcs.delete_reservation if parent_rpcs.respond_to? :delete_reservation + @delete_reservation = ::Gapic::Config::Method.new delete_reservation_config + update_reservation_config = parent_rpcs.update_reservation if parent_rpcs.respond_to? :update_reservation + @update_reservation = ::Gapic::Config::Method.new update_reservation_config + failover_reservation_config = parent_rpcs.failover_reservation if parent_rpcs.respond_to? :failover_reservation + @failover_reservation = ::Gapic::Config::Method.new failover_reservation_config + create_capacity_commitment_config = parent_rpcs.create_capacity_commitment if parent_rpcs.respond_to? :create_capacity_commitment + @create_capacity_commitment = ::Gapic::Config::Method.new create_capacity_commitment_config + list_capacity_commitments_config = parent_rpcs.list_capacity_commitments if parent_rpcs.respond_to? :list_capacity_commitments + @list_capacity_commitments = ::Gapic::Config::Method.new list_capacity_commitments_config + get_capacity_commitment_config = parent_rpcs.get_capacity_commitment if parent_rpcs.respond_to? :get_capacity_commitment + @get_capacity_commitment = ::Gapic::Config::Method.new get_capacity_commitment_config + delete_capacity_commitment_config = parent_rpcs.delete_capacity_commitment if parent_rpcs.respond_to? :delete_capacity_commitment + @delete_capacity_commitment = ::Gapic::Config::Method.new delete_capacity_commitment_config + update_capacity_commitment_config = parent_rpcs.update_capacity_commitment if parent_rpcs.respond_to? :update_capacity_commitment + @update_capacity_commitment = ::Gapic::Config::Method.new update_capacity_commitment_config + split_capacity_commitment_config = parent_rpcs.split_capacity_commitment if parent_rpcs.respond_to? :split_capacity_commitment + @split_capacity_commitment = ::Gapic::Config::Method.new split_capacity_commitment_config + merge_capacity_commitments_config = parent_rpcs.merge_capacity_commitments if parent_rpcs.respond_to? :merge_capacity_commitments + @merge_capacity_commitments = ::Gapic::Config::Method.new merge_capacity_commitments_config + create_assignment_config = parent_rpcs.create_assignment if parent_rpcs.respond_to? :create_assignment + @create_assignment = ::Gapic::Config::Method.new create_assignment_config + list_assignments_config = parent_rpcs.list_assignments if parent_rpcs.respond_to? :list_assignments + @list_assignments = ::Gapic::Config::Method.new list_assignments_config + delete_assignment_config = parent_rpcs.delete_assignment if parent_rpcs.respond_to? :delete_assignment + @delete_assignment = ::Gapic::Config::Method.new delete_assignment_config + search_assignments_config = parent_rpcs.search_assignments if parent_rpcs.respond_to? :search_assignments + @search_assignments = ::Gapic::Config::Method.new search_assignments_config + search_all_assignments_config = parent_rpcs.search_all_assignments if parent_rpcs.respond_to? :search_all_assignments + @search_all_assignments = ::Gapic::Config::Method.new search_all_assignments_config + move_assignment_config = parent_rpcs.move_assignment if parent_rpcs.respond_to? :move_assignment + @move_assignment = ::Gapic::Config::Method.new move_assignment_config + update_assignment_config = parent_rpcs.update_assignment if parent_rpcs.respond_to? :update_assignment + @update_assignment = ::Gapic::Config::Method.new update_assignment_config + get_bi_reservation_config = parent_rpcs.get_bi_reservation if parent_rpcs.respond_to? :get_bi_reservation + @get_bi_reservation = ::Gapic::Config::Method.new get_bi_reservation_config + update_bi_reservation_config = parent_rpcs.update_bi_reservation if parent_rpcs.respond_to? :update_bi_reservation + @update_bi_reservation = ::Gapic::Config::Method.new update_bi_reservation_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + create_reservation_group_config = parent_rpcs.create_reservation_group if parent_rpcs.respond_to? :create_reservation_group + @create_reservation_group = ::Gapic::Config::Method.new create_reservation_group_config + get_reservation_group_config = parent_rpcs.get_reservation_group if parent_rpcs.respond_to? :get_reservation_group + @get_reservation_group = ::Gapic::Config::Method.new get_reservation_group_config + delete_reservation_group_config = parent_rpcs.delete_reservation_group if parent_rpcs.respond_to? :delete_reservation_group + @delete_reservation_group = ::Gapic::Config::Method.new delete_reservation_group_config + list_reservation_groups_config = parent_rpcs.list_reservation_groups if parent_rpcs.respond_to? :list_reservation_groups + @list_reservation_groups = ::Gapic::Config::Method.new list_reservation_groups_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/service_stub.rb new file mode 100644 index 000000000000..d8fad30b5458 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/service_stub.rb @@ -0,0 +1,1889 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/bigquery/reservation/v1/reservation_pb" + +module Google + module Cloud + module Bigquery + module Reservation + module V1 + module ReservationService + module Rest + ## + # REST service stub for the ReservationService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_reservation REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest] + # 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::Bigquery::Reservation::V1::Reservation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # A result object deserialized from the server's reply + def create_reservation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_reservation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_reservation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_reservations REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest] + # 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::Bigquery::Reservation::V1::ListReservationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::ListReservationsResponse] + # A result object deserialized from the server's reply + def list_reservations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_reservations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_reservations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_reservation REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest] + # 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::Bigquery::Reservation::V1::Reservation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # A result object deserialized from the server's reply + def get_reservation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_reservation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_reservation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_reservation REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_reservation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_reservation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_reservation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_reservation REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest] + # 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::Bigquery::Reservation::V1::Reservation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # A result object deserialized from the server's reply + def update_reservation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_reservation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_reservation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the failover_reservation REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest] + # 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::Bigquery::Reservation::V1::Reservation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # A result object deserialized from the server's reply + def failover_reservation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_failover_reservation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "failover_reservation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_capacity_commitment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest] + # 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::Bigquery::Reservation::V1::CapacityCommitment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # A result object deserialized from the server's reply + def create_capacity_commitment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_capacity_commitment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_capacity_commitment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_capacity_commitments REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest] + # 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::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse] + # A result object deserialized from the server's reply + def list_capacity_commitments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_capacity_commitments_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_capacity_commitments", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_capacity_commitment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest] + # 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::Bigquery::Reservation::V1::CapacityCommitment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # A result object deserialized from the server's reply + def get_capacity_commitment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_capacity_commitment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_capacity_commitment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_capacity_commitment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_capacity_commitment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_capacity_commitment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_capacity_commitment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_capacity_commitment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest] + # 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::Bigquery::Reservation::V1::CapacityCommitment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # A result object deserialized from the server's reply + def update_capacity_commitment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_capacity_commitment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_capacity_commitment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the split_capacity_commitment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest] + # 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::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse] + # A result object deserialized from the server's reply + def split_capacity_commitment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_split_capacity_commitment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "split_capacity_commitment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the merge_capacity_commitments REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest] + # 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::Bigquery::Reservation::V1::CapacityCommitment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # A result object deserialized from the server's reply + def merge_capacity_commitments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_merge_capacity_commitments_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "merge_capacity_commitments", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_assignment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest] + # 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::Bigquery::Reservation::V1::Assignment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # A result object deserialized from the server's reply + def create_assignment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_assignment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_assignment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_assignments REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest] + # 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::Bigquery::Reservation::V1::ListAssignmentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsResponse] + # A result object deserialized from the server's reply + def list_assignments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_assignments_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_assignments", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_assignment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_assignment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_assignment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_assignment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_assignments REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest] + # 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::Bigquery::Reservation::V1::SearchAssignmentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsResponse] + # A result object deserialized from the server's reply + def search_assignments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_assignments_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "search_assignments", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_all_assignments REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest] + # 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::Bigquery::Reservation::V1::SearchAllAssignmentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsResponse] + # A result object deserialized from the server's reply + def search_all_assignments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_all_assignments_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "search_all_assignments", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the move_assignment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest] + # 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::Bigquery::Reservation::V1::Assignment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # A result object deserialized from the server's reply + def move_assignment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_move_assignment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "move_assignment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_assignment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest] + # 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::Bigquery::Reservation::V1::Assignment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # A result object deserialized from the server's reply + def update_assignment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_assignment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_assignment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_bi_reservation REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest] + # 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::Bigquery::Reservation::V1::BiReservation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] + # A result object deserialized from the server's reply + def get_bi_reservation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_bi_reservation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_bi_reservation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::BiReservation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_bi_reservation REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest] + # 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::Bigquery::Reservation::V1::BiReservation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] + # A result object deserialized from the server's reply + def update_bi_reservation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_bi_reservation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_bi_reservation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::BiReservation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_reservation_group REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest] + # 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::Bigquery::Reservation::V1::ReservationGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] + # A result object deserialized from the server's reply + def create_reservation_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_reservation_group_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_reservation_group", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_reservation_group REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest] + # 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::Bigquery::Reservation::V1::ReservationGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] + # A result object deserialized from the server's reply + def get_reservation_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_reservation_group_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_reservation_group", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_reservation_group REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_reservation_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_reservation_group_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_reservation_group", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_reservation_groups REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest] + # 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::Bigquery::Reservation::V1::ListReservationGroupsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsResponse] + # A result object deserialized from the server's reply + def list_reservation_groups request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_reservation_groups_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_reservation_groups", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_reservation REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_reservation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/reservations", + body: "reservation", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_reservations REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_reservations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/reservations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_reservation REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_reservation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_reservation REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_reservation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_reservation REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_reservation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{reservation.name}", + body: "reservation", + matches: [ + ["reservation.name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the failover_reservation REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_failover_reservation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:failoverReservation", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_capacity_commitment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_capacity_commitment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/capacityCommitments", + body: "capacity_commitment", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_capacity_commitments REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_capacity_commitments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/capacityCommitments", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_capacity_commitment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_capacity_commitment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/capacityCommitments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_capacity_commitment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_capacity_commitment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/capacityCommitments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_capacity_commitment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_capacity_commitment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{capacity_commitment.name}", + body: "capacity_commitment", + matches: [ + ["capacity_commitment.name", %r{^projects/[^/]+/locations/[^/]+/capacityCommitments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the split_capacity_commitment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_split_capacity_commitment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:split", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/capacityCommitments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the merge_capacity_commitments REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_merge_capacity_commitments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/capacityCommitments:merge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_assignment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_assignment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/assignments", + body: "assignment", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_assignments REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_assignments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/assignments", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_assignment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_assignment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_assignments REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_assignments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}:searchAssignments", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_all_assignments REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_all_assignments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}:searchAllAssignments", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the move_assignment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_move_assignment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:move", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_assignment REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_assignment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{assignment.name}", + body: "assignment", + matches: [ + ["assignment.name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_bi_reservation REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_bi_reservation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/biReservation/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_bi_reservation REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_bi_reservation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{bi_reservation.name}", + body: "bi_reservation", + matches: [ + ["bi_reservation.name", %r{^projects/[^/]+/locations/[^/]+/biReservation/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_reservation_group REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_reservation_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/reservationGroups", + body: "reservation_group", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_reservation_group REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_reservation_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reservationGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_reservation_group REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_reservation_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reservationGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_reservation_groups REST call + # + # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_reservation_groups_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/reservationGroups", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_services_pb.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_services_pb.rb new file mode 100644 index 000000000000..4f6d5bcb42f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_services_pb.rb @@ -0,0 +1,297 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/bigquery/reservation/v1/reservation.proto for package 'google.cloud.bigquery.reservation.v1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/bigquery/reservation/v1/reservation_pb' + +module Google + module Cloud + module Bigquery + module Reservation + module V1 + module ReservationService + # This API allows users to manage their BigQuery reservations. + # + # A reservation provides computational resource guarantees, in the form of + # [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a + # unit of computational power in BigQuery, and serves as the basic unit of + # parallelism. In a scan of a multi-partitioned table, a single slot operates + # on a single partition of the table. A reservation resource exists as a child + # resource of the admin project and location, e.g.: + # `projects/myproject/locations/US/reservations/reservationName`. + # + # A capacity commitment is a way to purchase compute capacity for BigQuery jobs + # (in the form of slots) with some committed period of usage. A capacity + # commitment resource exists as a child resource of the admin project and + # location, e.g.: + # `projects/myproject/locations/US/capacityCommitments/id`. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.bigquery.reservation.v1.ReservationService' + + # Creates a new reservation resource. + rpc :CreateReservation, ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest, ::Google::Cloud::Bigquery::Reservation::V1::Reservation + # Lists all the reservations for the project in the specified location. + rpc :ListReservations, ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest, ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsResponse + # Returns information about the reservation. + rpc :GetReservation, ::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest, ::Google::Cloud::Bigquery::Reservation::V1::Reservation + # Deletes a reservation. + # Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + # assignments. + rpc :DeleteReservation, ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest, ::Google::Protobuf::Empty + # Updates an existing reservation resource. + rpc :UpdateReservation, ::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest, ::Google::Cloud::Bigquery::Reservation::V1::Reservation + # Fail over a reservation to the secondary location. The operation should be + # done in the current secondary location, which will be promoted to the + # new primary location for the reservation. + # Attempting to failover a reservation in the current primary location will + # fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. + rpc :FailoverReservation, ::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest, ::Google::Cloud::Bigquery::Reservation::V1::Reservation + # Creates a new capacity commitment resource. + rpc :CreateCapacityCommitment, ::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest, ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment + # Lists all the capacity commitments for the admin project. + rpc :ListCapacityCommitments, ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest, ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse + # Returns information about the capacity commitment. + rpc :GetCapacityCommitment, ::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest, ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment + # Deletes a capacity commitment. Attempting to delete capacity commitment + # before its commitment_end_time will fail with the error code + # `google.rpc.Code.FAILED_PRECONDITION`. + rpc :DeleteCapacityCommitment, ::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest, ::Google::Protobuf::Empty + # Updates an existing capacity commitment. + # + # Only `plan` and `renewal_plan` fields can be updated. + # + # Plan can only be changed to a plan of a longer commitment period. + # Attempting to change to a plan with shorter commitment period will fail + # with the error code `google.rpc.Code.FAILED_PRECONDITION`. + rpc :UpdateCapacityCommitment, ::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest, ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment + # Splits capacity commitment to two commitments of the same plan and + # `commitment_end_time`. + # + # A common use case is to enable downgrading commitments. + # + # For example, in order to downgrade from 10000 slots to 8000, you might + # split a 10000 capacity commitment into commitments of 2000 and 8000. Then, + # you delete the first one after the commitment end time passes. + rpc :SplitCapacityCommitment, ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest, ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse + # Merges capacity commitments of the same plan into a single commitment. + # + # The resulting capacity commitment has the greater commitment_end_time + # out of the to-be-merged capacity commitments. + # + # Attempting to merge capacity commitments of different plan will fail + # with the error code `google.rpc.Code.FAILED_PRECONDITION`. + rpc :MergeCapacityCommitments, ::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest, ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment + # Creates an assignment object which allows the given project to submit jobs + # of a certain type using slots from the specified reservation. + # + # Currently a + # resource (project, folder, organization) can only have one assignment per + # each (job_type, location) combination, and that reservation will be used + # for all jobs of the matching type. + # + # Different assignments can be created on different levels of the + # projects, folders or organization hierarchy. During query execution, + # the assignment is looked up at the project, folder and organization levels + # in that order. The first assignment found is applied to the query. + # + # When creating assignments, it does not matter if other assignments exist at + # higher levels. + # + # Example: + # + # * The organization `organizationA` contains two projects, `project1` + # and `project2`. + # * Assignments for all three entities (`organizationA`, `project1`, and + # `project2`) could all be created and mapped to the same or different + # reservations. + # + # "None" assignments represent an absence of the assignment. Projects + # assigned to None use on-demand pricing. To create a "None" assignment, use + # "none" as a reservation_id in the parent. Example parent: + # `projects/myproject/locations/US/reservations/none`. + # + # Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have + # 'bigquery.admin' permissions on the project using the reservation + # and the project that owns this reservation. + # + # Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment + # does not match location of the reservation. + rpc :CreateAssignment, ::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest, ::Google::Cloud::Bigquery::Reservation::V1::Assignment + # Lists assignments. + # + # Only explicitly created assignments will be returned. + # + # Example: + # + # * Organization `organizationA` contains two projects, `project1` and + # `project2`. + # * Reservation `res1` exists and was created previously. + # * CreateAssignment was used previously to define the following + # associations between entities and reservations: `` + # and `` + # + # In this example, ListAssignments will just return the above two assignments + # for reservation `res1`, and no expansion/merge will happen. + # + # The wildcard "-" can be used for + # reservations in the request. In that case all assignments belongs to the + # specified project and location will be listed. + # + # **Note** "-" cannot be used for projects nor locations. + rpc :ListAssignments, ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest, ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsResponse + # Deletes a assignment. No expansion will happen. + # + # Example: + # + # * Organization `organizationA` contains two projects, `project1` and + # `project2`. + # * Reservation `res1` exists and was created previously. + # * CreateAssignment was used previously to define the following + # associations between entities and reservations: `` + # and `` + # + # In this example, deletion of the `` assignment won't + # affect the other assignment ``. After said deletion, + # queries from `project1` will still use `res1` while queries from + # `project2` will switch to use on-demand mode. + rpc :DeleteAssignment, ::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest, ::Google::Protobuf::Empty + # Deprecated: Looks up assignments for a specified resource for a particular + # region. If the request is about a project: + # + # 1. Assignments created on the project will be returned if they exist. + # 2. Otherwise assignments created on the closest ancestor will be + # returned. + # 3. Assignments for different JobTypes will all be returned. + # + # The same logic applies if the request is about a folder. + # + # If the request is about an organization, then assignments created on the + # organization will be returned (organization doesn't have ancestors). + # + # Comparing to ListAssignments, there are some behavior + # differences: + # + # 1. permission on the assignee will be verified in this API. + # 2. Hierarchy lookup (project->folder->organization) happens in this API. + # 3. Parent here is `projects/*/locations/*`, instead of + # `projects/*/locations/*reservations/*`. + # + # **Note** "-" cannot be used for projects + # nor locations. + rpc :SearchAssignments, ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest, ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsResponse + # Looks up assignments for a specified resource for a particular region. + # If the request is about a project: + # + # 1. Assignments created on the project will be returned if they exist. + # 2. Otherwise assignments created on the closest ancestor will be + # returned. + # 3. Assignments for different JobTypes will all be returned. + # + # The same logic applies if the request is about a folder. + # + # If the request is about an organization, then assignments created on the + # organization will be returned (organization doesn't have ancestors). + # + # Comparing to ListAssignments, there are some behavior + # differences: + # + # 1. permission on the assignee will be verified in this API. + # 2. Hierarchy lookup (project->folder->organization) happens in this API. + # 3. Parent here is `projects/*/locations/*`, instead of + # `projects/*/locations/*reservations/*`. + rpc :SearchAllAssignments, ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest, ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsResponse + # Moves an assignment under a new reservation. + # + # This differs from removing an existing assignment and recreating a new one + # by providing a transactional change that ensures an assignee always has an + # associated reservation. + rpc :MoveAssignment, ::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest, ::Google::Cloud::Bigquery::Reservation::V1::Assignment + # Updates an existing assignment. + # + # Only the `priority` field can be updated. + rpc :UpdateAssignment, ::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest, ::Google::Cloud::Bigquery::Reservation::V1::Assignment + # Retrieves a BI reservation. + rpc :GetBiReservation, ::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest, ::Google::Cloud::Bigquery::Reservation::V1::BiReservation + # Updates a BI reservation. + # + # Only fields specified in the `field_mask` are updated. + # + # A singleton BI reservation always exists with default size 0. + # In order to reserve BI capacity it needs to be updated to an amount + # greater than 0. In order to release BI capacity reservation size + # must be set to 0. + rpc :UpdateBiReservation, ::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest, ::Google::Cloud::Bigquery::Reservation::V1::BiReservation + # Gets the access control policy for a resource. + # May return: + # + # * A`NOT_FOUND` error if the resource doesn't exist or you don't have the + # permission to view it. + # * An empty policy if the resource exists but doesn't have a set policy. + # + # Supported resources are: + # - Reservations + # - ReservationAssignments + # + # To call this method, you must have the following Google IAM permissions: + # + # - `bigqueryreservation.reservations.getIamPolicy` to get policies on + # reservations. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Sets an access control policy for a resource. Replaces any existing + # policy. + # + # Supported resources are: + # - Reservations + # + # To call this method, you must have the following Google IAM permissions: + # + # - `bigqueryreservation.reservations.setIamPolicy` to set policies on + # reservations. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Gets your permissions on a resource. Returns an empty set of permissions if + # the resource doesn't exist. + # + # Supported resources are: + # - Reservations + # + # No Google IAM permissions are required to call this method. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + # Creates a new reservation group. + rpc :CreateReservationGroup, ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest, ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup + # Returns information about the reservation group. + rpc :GetReservationGroup, ::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest, ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup + # Deletes a reservation. + # Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + # assignments. + rpc :DeleteReservationGroup, ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest, ::Google::Protobuf::Empty + # Lists all the reservation groups for the project in the specified location. + rpc :ListReservationGroups, ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest, ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/rest.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/rest.rb new file mode 100644 index 000000000000..1cec46fd7cad --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/rest.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/bigquery/reservation/v1/reservation_service/rest" +require "google/cloud/bigquery/reservation/v1/version" + +module Google + module Cloud + module Bigquery + module Reservation + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/bigquery/reservation/v1/rest" + # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new + # + module V1 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/version.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/version.rb new file mode 100644 index 000000000000..30a621b3b473 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/version.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Bigquery + module Reservation + module V1 + VERSION = "0.0.1" + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/README.md new file mode 100644 index 000000000000..dcf8e9f79d59 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# BigQuery Reservation 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-bigquery-reservation-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..c6b6b60729c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..fb9115c630af --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..b836bdb60b21 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..71b994c7ef20 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/cloud/bigquery/reservation/v1/reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/cloud/bigquery/reservation/v1/reservation.rb new file mode 100644 index 000000000000..fc8a9f0108d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/cloud/bigquery/reservation/v1/reservation.rb @@ -0,0 +1,1190 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Bigquery + module Reservation + module V1 + # A reservation is a mechanism used to guarantee slots to users. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the reservation, e.g., + # `projects/*/locations/*/reservations/team1-prod`. + # The reservation_id must only contain lower case alphanumeric characters or + # dashes. It must start with a letter and must not end with a dash. Its + # maximum length is 64 characters. + # @!attribute [rw] slot_capacity + # @return [::Integer] + # Optional. Baseline slots available to this reservation. A slot is a unit of + # computational power in BigQuery, and serves as the unit of parallelism. + # + # Queries using this reservation might use more slots during runtime if + # ignore_idle_slots is set to false, or autoscaling is enabled. + # + # The total slot_capacity of the reservation and its siblings + # may exceed the total slot_count of capacity commitments. In that case, the + # exceeding slots will be charged with the autoscale SKU. You can increase + # the number of baseline slots in a reservation every few minutes. If you + # want to decrease your baseline slots, you are limited to once an hour if + # you have recently changed your baseline slot capacity and your baseline + # slots exceed your committed slots. Otherwise, you can decrease your + # baseline slots every few minutes. + # @!attribute [rw] ignore_idle_slots + # @return [::Boolean] + # Optional. If false, any query or pipeline job using this reservation will + # use idle slots from other reservations within the same admin project. If + # true, a query or pipeline job using this reservation will execute with the + # slot capacity specified in the slot_capacity field at most. + # @!attribute [rw] autoscale + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation::Autoscale] + # Optional. The configuration parameters for the auto scaling feature. + # @!attribute [rw] concurrency + # @return [::Integer] + # Optional. Job concurrency target which sets a soft upper bound on the + # number of jobs that can run concurrently in this reservation. This is a + # soft target due to asynchronous nature of the system and various + # optimizations for small queries. Default value is 0 which means that + # concurrency target will be automatically computed by the system. NOTE: this + # field is exposed as target job concurrency in the Information Schema, DDL + # and BigQuery CLI. + # @!attribute [r] creation_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of the reservation. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last update time of the reservation. + # @!attribute [rw] multi_region_auxiliary + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Applicable only for reservations located within one of the BigQuery + # multi-regions (US or EU). + # + # If set to true, this reservation is placed in the organization's + # secondary region which is designated for disaster recovery purposes. + # If false, this reservation is placed in the organization's default region. + # + # NOTE: this is a preview feature. Project must be allow-listed in order to + # set this field. + # @!attribute [rw] edition + # @return [::Google::Cloud::Bigquery::Reservation::V1::Edition] + # Optional. Edition of the reservation. + # @!attribute [r] primary_location + # @return [::String] + # Output only. The current location of the reservation's primary replica. + # This field is only set for reservations using the managed disaster recovery + # feature. + # @!attribute [rw] secondary_location + # @return [::String] + # Optional. The current location of the reservation's secondary replica. This + # field is only set for reservations using the managed disaster recovery + # feature. Users can set this in create reservation calls + # to create a failover reservation or in update reservation calls to convert + # a non-failover reservation to a failover reservation(or vice versa). + # @!attribute [r] original_primary_location + # @return [::String] + # Output only. The location where the reservation was originally created. + # This is set only during the failover reservation's creation. All billing + # charges for the failover reservation will be applied to this location. + # @!attribute [rw] max_slots + # @return [::Integer] + # Optional. The overall max slots for the reservation, covering slot_capacity + # (baseline), idle slots (if ignore_idle_slots is false) and scaled slots. + # If present, the reservation won't use more than the specified number of + # slots, even if there is demand and supply (from idle slots). + # NOTE: capping a reservation's idle slot usage is best effort and its + # usage may exceed the max_slots value. However, in terms of + # autoscale.current_slots (which accounts for the additional added slots), it + # will never exceed the max_slots - baseline. + # + # + # This field must be set together with the scaling_mode enum value, + # otherwise the request will be rejected with error code + # `google.rpc.Code.INVALID_ARGUMENT`. + # + # If the max_slots and scaling_mode are set, the autoscale or + # autoscale.max_slots field must be unset. Otherwise the request will be + # rejected with error code `google.rpc.Code.INVALID_ARGUMENT`. However, the + # autoscale field may still be in the output. The autopscale.max_slots will + # always show as 0 and the autoscaler.current_slots will represent the + # current slots from autoscaler excluding idle slots. + # For example, if the max_slots is 1000 and scaling_mode is AUTOSCALE_ONLY, + # then in the output, the autoscaler.max_slots will be 0 and the + # autoscaler.current_slots may be any value between 0 and 1000. + # + # If the max_slots is 1000, scaling_mode is ALL_SLOTS, the baseline is 100 + # and idle slots usage is 200, then in the output, the autoscaler.max_slots + # will be 0 and the autoscaler.current_slots will not be higher than 700. + # + # If the max_slots is 1000, scaling_mode is IDLE_SLOTS_ONLY, then in the + # output, the autoscaler field will be null. + # + # If the max_slots and scaling_mode are set, then the ignore_idle_slots field + # must be aligned with the scaling_mode enum value.(See details in + # ScalingMode comments). Otherwise the request will be rejected with + # error code `google.rpc.Code.INVALID_ARGUMENT`. + # + # Please note, the max_slots is for user to manage the part of slots greater + # than the baseline. Therefore, we don't allow users to set max_slots smaller + # or equal to the baseline as it will not be meaningful. If the field is + # present and slot_capacity>=max_slots, requests will be rejected with error + # code `google.rpc.Code.INVALID_ARGUMENT`. + # + # Please note that if max_slots is set to 0, we will treat it as unset. + # Customers can set max_slots to 0 and set scaling_mode to + # SCALING_MODE_UNSPECIFIED to disable the max_slots feature. + # @!attribute [rw] scaling_mode + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation::ScalingMode] + # Optional. The scaling mode for the reservation. + # If the field is present but max_slots is not present, requests will be + # rejected with error code `google.rpc.Code.INVALID_ARGUMENT`. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels associated with this reservation. You can use these + # to organize and group your reservations. + # You can set this property when you create or update a reservation. + # @!attribute [rw] reservation_group + # @return [::String] + # Optional. The reservation group that this reservation belongs to. + # You can set this property when you create or update a reservation. + # Reservations do not need to belong to a reservation group. + # Format: + # projects/\\{project}/locations/\\{location}/reservationGroups/\\{reservation_group} + # or just \\{reservation_group} + # @!attribute [r] replication_status + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation::ReplicationStatus] + # Output only. The Disaster Recovery(DR) replication status of the + # reservation. This is only available for the primary replicas of DR/failover + # reservations and provides information about the both the staleness of the + # secondary and the last error encountered while trying to replicate changes + # from the primary to the secondary. If this field is blank, it means that + # the reservation is either not a DR reservation or the reservation is a DR + # secondary or that any replication operations on the reservation have + # succeeded. + # @!attribute [rw] scheduling_policy + # @return [::Google::Cloud::Bigquery::Reservation::V1::SchedulingPolicy] + # Optional. The scheduling policy to use for jobs and queries running under + # this reservation. The scheduling policy controls how the reservation's + # resources are distributed. + # + # This feature is not yet generally available. + class Reservation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Auto scaling settings. + # @!attribute [r] current_slots + # @return [::Integer] + # Output only. The slot capacity added to this reservation when autoscale + # happens. Will be between [0, max_slots]. Note: after users reduce + # max_slots, it may take a while before it can be propagated, so + # current_slots may stay in the original value and could be larger than + # max_slots for that brief period (less than one minute) + # @!attribute [rw] max_slots + # @return [::Integer] + # Optional. Number of slots to be scaled when needed. + class Autoscale + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Disaster Recovery(DR) replication status of the reservation. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. The last error encountered while trying to replicate changes + # from the primary to the secondary. This field is only available if the + # replication has not succeeded since. + # @!attribute [r] last_error_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the last error was encountered while + # trying to replicate changes from the primary to the secondary. This field + # is only available if the replication has not succeeded since. + # @!attribute [r] last_replication_time + # @return [::Google::Protobuf::Timestamp] + # Output only. A timestamp corresponding to the last change on the primary + # that was successfully replicated to the secondary. + # @!attribute [r] soft_failover_start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which a soft failover for the reservation and + # its associated datasets was initiated. After this field is set, all + # subsequent changes to the reservation will be rejected unless a hard + # failover overrides this operation. This field will be cleared once the + # failover is complete. + class ReplicationStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The scaling mode for the reservation. This enum determines how the + # reservation scales up and down. + module ScalingMode + # Default value of ScalingMode. + SCALING_MODE_UNSPECIFIED = 0 + + # The reservation will scale up only using slots from autoscaling. It will + # not use any idle slots even if there may be some available. The upper + # limit that autoscaling can scale up to will be max_slots - baseline. + # For example, if max_slots is 1000, baseline is 200 and customer sets + # ScalingMode to AUTOSCALE_ONLY, then autoscalerg will scale up to 800 + # slots and no idle slots will be used. + # + # Please note, in this mode, the ignore_idle_slots field must be set to + # true. Otherwise the request will be rejected with error code + # `google.rpc.Code.INVALID_ARGUMENT`. + AUTOSCALE_ONLY = 1 + + # The reservation will scale up using only idle slots contributed by + # other reservations or from unassigned commitments. If no idle slots are + # available it will not scale up further. If the idle slots which it is + # using are reclaimed by the contributing reservation(s) it may be forced + # to scale down. The max idle slots the reservation can be max_slots - + # baseline capacity. For example, if max_slots is 1000, baseline is 200 and + # customer sets ScalingMode to IDLE_SLOTS_ONLY, + # 1. if there are 1000 idle slots available in other reservations, the + # reservation will scale up to 1000 slots with 200 baseline and 800 idle + # slots. + # 2. if there are 500 idle slots available in other reservations, the + # reservation will scale up to 700 slots with 200 baseline and 300 idle + # slots. + # Please note, in this mode, the reservation might not be able to scale up + # to max_slots. + # + # Please note, in this mode, the ignore_idle_slots field must be set to + # false. Otherwise the request will be rejected with error code + # `google.rpc.Code.INVALID_ARGUMENT`. + IDLE_SLOTS_ONLY = 2 + + # The reservation will scale up using all slots available to it. It will + # use idle slots contributed by other reservations or from unassigned + # commitments first. If no idle slots are available it will scale up using + # autoscaling. For example, if max_slots is 1000, baseline is 200 and + # customer sets ScalingMode to ALL_SLOTS, + # 1. if there are 800 idle slots available in other reservations, the + # reservation will scale up to 1000 slots with 200 baseline and 800 idle + # slots. + # 2. if there are 500 idle slots available in other reservations, the + # reservation will scale up to 1000 slots with 200 baseline, 500 idle + # slots and 300 autoscaling slots. + # 3. if there are no idle slots available in other reservations, it will + # scale up to 1000 slots with 200 baseline and 800 autoscaling slots. + # + # Please note, in this mode, the ignore_idle_slots field must be set to + # false. Otherwise the request will be rejected with error code + # `google.rpc.Code.INVALID_ARGUMENT`. + ALL_SLOTS = 3 + end + end + + # The scheduling policy controls how a reservation's resources are distributed. + # @!attribute [rw] concurrency + # @return [::Integer] + # Optional. If present and > 0, the reservation will attempt to limit the + # concurrency of jobs running for any particular project within it to the + # given value. + # + # This feature is not yet generally available. + # @!attribute [rw] max_slots + # @return [::Integer] + # Optional. If present and > 0, the reservation will attempt to limit the + # slot consumption of queries running for any particular project within it to + # the given value. + # + # This feature is not yet generally available. + class SchedulingPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A reservation group is a container for reservations. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the reservation group, e.g., + # `projects/*/locations/*/reservationGroups/team1-prod`. + # The reservation_group_id must only contain lower case alphanumeric + # characters or dashes. It must start with a letter and must not end with a + # dash. Its maximum length is 64 characters. + class ReservationGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Capacity commitment is a way to purchase compute capacity for BigQuery jobs + # (in the form of slots) with some committed period of usage. Annual + # commitments renew by default. Commitments can be removed after their + # commitment end time passes. + # + # In order to remove annual commitment, its plan needs to be changed + # to monthly or flex first. + # + # A capacity commitment resource exists as a child resource of the admin + # project. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the capacity commitment, e.g., + # `projects/myproject/locations/US/capacityCommitments/123` + # The commitment_id must only contain lower case alphanumeric characters or + # dashes. It must start with a letter and must not end + # with a dash. Its maximum length is 64 characters. + # @!attribute [rw] slot_count + # @return [::Integer] + # Optional. Number of slots in this commitment. + # @!attribute [rw] plan + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::CommitmentPlan] + # Optional. Capacity commitment commitment plan. + # @!attribute [r] state + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::State] + # Output only. State of the commitment. + # @!attribute [r] commitment_start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The start of the current commitment period. It is applicable + # only for ACTIVE capacity commitments. Note after the commitment is renewed, + # commitment_start_time won't be changed. It refers to the start time of the + # original commitment. + # @!attribute [r] commitment_end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The end of the current commitment period. It is applicable + # only for ACTIVE capacity commitments. Note after renewal, + # commitment_end_time is the time the renewed commitment expires. So itwould + # be at a time after commitment_start_time + committed period, because we + # don't change commitment_start_time , + # @!attribute [r] failure_status + # @return [::Google::Rpc::Status] + # Output only. For FAILED commitment plan, provides the reason of failure. + # @!attribute [rw] renewal_plan + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::CommitmentPlan] + # Optional. The plan this capacity commitment is converted to after + # commitment_end_time passes. Once the plan is changed, committed period is + # extended according to commitment plan. Only applicable for ANNUAL and TRIAL + # commitments. + # @!attribute [rw] multi_region_auxiliary + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Applicable only for commitments located within one of the BigQuery + # multi-regions (US or EU). + # + # If set to true, this commitment is placed in the organization's + # secondary region which is designated for disaster recovery purposes. + # If false, this commitment is placed in the organization's default region. + # + # NOTE: this is a preview feature. Project must be allow-listed in order to + # set this field. + # @!attribute [rw] edition + # @return [::Google::Cloud::Bigquery::Reservation::V1::Edition] + # Optional. Edition of the capacity commitment. + # @!attribute [r] is_flat_rate + # @return [::Boolean] + # Output only. If true, the commitment is a flat-rate commitment, otherwise, + # it's an edition commitment. + class CapacityCommitment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Commitment plan defines the current committed period. Capacity commitment + # cannot be deleted during it's committed period. + module CommitmentPlan + # Invalid plan value. Requests with this value will be rejected with + # error code `google.rpc.Code.INVALID_ARGUMENT`. + COMMITMENT_PLAN_UNSPECIFIED = 0 + + # Flex commitments have committed period of 1 minute after becoming ACTIVE. + # After that, they are not in a committed period anymore and can be removed + # any time. + FLEX = 3 + + # Same as FLEX, should only be used if flat-rate commitments are still + # available. + FLEX_FLAT_RATE = 7 + + # Trial commitments have a committed period of 182 days after becoming + # ACTIVE. After that, they are converted to a new commitment based on the + # `renewal_plan`. Default `renewal_plan` for Trial commitment is Flex so + # that it can be deleted right after committed period ends. + TRIAL = 5 + + # Monthly commitments have a committed period of 30 days after becoming + # ACTIVE. After that, they are not in a committed period anymore and can be + # removed any time. + MONTHLY = 2 + + # Same as MONTHLY, should only be used if flat-rate commitments are still + # available. + MONTHLY_FLAT_RATE = 8 + + # Annual commitments have a committed period of 365 days after becoming + # ACTIVE. After that they are converted to a new commitment based on the + # renewal_plan. + ANNUAL = 4 + + # Same as ANNUAL, should only be used if flat-rate commitments are still + # available. + ANNUAL_FLAT_RATE = 9 + + # 3-year commitments have a committed period of 1095(3 * 365) days after + # becoming ACTIVE. After that they are converted to a new commitment based + # on the renewal_plan. + THREE_YEAR = 10 + + # Should only be used for `renewal_plan` and is only meaningful if + # edition is specified to values other than EDITION_UNSPECIFIED. Otherwise + # CreateCapacityCommitmentRequest or UpdateCapacityCommitmentRequest will + # be rejected with error code `google.rpc.Code.INVALID_ARGUMENT`. If the + # renewal_plan is NONE, capacity commitment will be removed at the end of + # its commitment period. + NONE = 6 + end + + # Capacity commitment can either become ACTIVE right away or transition + # from PENDING to ACTIVE or FAILED. + module State + # Invalid state value. + STATE_UNSPECIFIED = 0 + + # Capacity commitment is pending provisioning. Pending capacity commitment + # does not contribute to the project's slot_capacity. + PENDING = 1 + + # Once slots are provisioned, capacity commitment becomes active. + # slot_count is added to the project's slot_capacity. + ACTIVE = 2 + + # Capacity commitment is failed to be activated by the backend. + FAILED = 3 + end + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_reservation ReservationService.CreateReservation}. + # @!attribute [rw] parent + # @return [::String] + # Required. Project, location. E.g., + # `projects/myproject/locations/US` + # @!attribute [rw] reservation_id + # @return [::String] + # The reservation ID. It must only contain lower case alphanumeric + # characters or dashes. It must start with a letter and must not end + # with a dash. Its maximum length is 64 characters. + # @!attribute [rw] reservation + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # Definition of the new reservation to create. + class CreateReservationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservations ReservationService.ListReservations}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name containing project and location, e.g.: + # `projects/myproject/locations/US` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return per page. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous List request, if any. + class ListReservationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservations ReservationService.ListReservations}. + # @!attribute [rw] reservations + # @return [::Array<::Google::Cloud::Bigquery::Reservation::V1::Reservation>] + # List of reservations visible to the user. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListReservationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_reservation ReservationService.GetReservation}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the reservation to retrieve. E.g., + # `projects/myproject/locations/US/reservations/team1-prod` + class GetReservationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation ReservationService.DeleteReservation}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the reservation to retrieve. E.g., + # `projects/myproject/locations/US/reservations/team1-prod` + class DeleteReservationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_reservation ReservationService.UpdateReservation}. + # @!attribute [rw] reservation + # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] + # Content of the reservation to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Standard field mask for the set of fields to be updated. + class UpdateReservationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for ReservationService.FailoverReservation. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the reservation to failover. E.g., + # `projects/myproject/locations/US/reservations/team1-prod` + # @!attribute [rw] failover_mode + # @return [::Google::Cloud::Bigquery::Reservation::V1::FailoverMode] + # Optional. A parameter that determines how writes that are pending + # replication are handled after a failover is initiated. If not specified, + # HARD failover mode is used by default. + class FailoverReservationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_reservation_group ReservationService.CreateReservationGroup}. + # @!attribute [rw] parent + # @return [::String] + # Required. Project, location. E.g., + # `projects/myproject/locations/US` + # @!attribute [rw] reservation_group_id + # @return [::String] + # Required. The reservation group ID. It must only contain lower case + # alphanumeric characters or dashes. It must start with a letter and must not + # end with a dash. Its maximum length is 64 characters. + # @!attribute [rw] reservation_group + # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] + # Required. New Reservation Group to create. + class CreateReservationGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_reservation_group ReservationService.GetReservationGroup}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the reservation group to retrieve. E.g., + # `projects/myproject/locations/US/reservationGroups/team1-prod` + class GetReservationGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservation_groups ReservationService.ListReservationGroups}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name containing project and location, e.g.: + # `projects/myproject/locations/US` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return per page. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous List request, if any. + class ListReservationGroupsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservation_groups ReservationService.ListReservationGroups}. + # @!attribute [rw] reservation_groups + # @return [::Array<::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup>] + # List of reservations visible to the user. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListReservationGroupsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation_group ReservationService.DeleteReservationGroup}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the reservation group to retrieve. E.g., + # `projects/myproject/locations/US/reservationGroups/team1-prod` + class DeleteReservationGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_capacity_commitment ReservationService.CreateCapacityCommitment}. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the parent reservation. E.g., + # `projects/myproject/locations/US` + # @!attribute [rw] capacity_commitment + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # Content of the capacity commitment to create. + # @!attribute [rw] enforce_single_admin_project_per_org + # @return [::Boolean] + # If true, fail the request if another project in the organization has a + # capacity commitment. + # @!attribute [rw] capacity_commitment_id + # @return [::String] + # The optional capacity commitment ID. Capacity commitment name will be + # generated automatically if this field is empty. + # This field must only contain lower case alphanumeric characters or dashes. + # The first and last character cannot be a dash. Max length is 64 characters. + # NOTE: this ID won't be kept if the capacity commitment is split or merged. + class CreateCapacityCommitmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_capacity_commitments ReservationService.ListCapacityCommitments}. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the parent reservation. E.g., + # `projects/myproject/locations/US` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous List request, if any. + class ListCapacityCommitmentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_capacity_commitments ReservationService.ListCapacityCommitments}. + # @!attribute [rw] capacity_commitments + # @return [::Array<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>] + # List of capacity commitments visible to the user. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListCapacityCommitmentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_capacity_commitment ReservationService.GetCapacityCommitment}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the capacity commitment to retrieve. E.g., + # `projects/myproject/locations/US/capacityCommitments/123` + class GetCapacityCommitmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_capacity_commitment ReservationService.DeleteCapacityCommitment}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the capacity commitment to delete. E.g., + # `projects/myproject/locations/US/capacityCommitments/123` + # @!attribute [rw] force + # @return [::Boolean] + # Can be used to force delete commitments even if assignments exist. Deleting + # commitments with assignments may cause queries to fail if they no longer + # have access to slots. + class DeleteCapacityCommitmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_capacity_commitment ReservationService.UpdateCapacityCommitment}. + # @!attribute [rw] capacity_commitment + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # Content of the capacity commitment to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Standard field mask for the set of fields to be updated. + class UpdateCapacityCommitmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#split_capacity_commitment ReservationService.SplitCapacityCommitment}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name e.g.,: + # `projects/myproject/locations/US/capacityCommitments/123` + # @!attribute [rw] slot_count + # @return [::Integer] + # Number of slots in the capacity commitment after the split. + class SplitCapacityCommitmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#split_capacity_commitment ReservationService.SplitCapacityCommitment}. + # @!attribute [rw] first + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # First capacity commitment, result of a split. + # @!attribute [rw] second + # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] + # Second capacity commitment, result of a split. + class SplitCapacityCommitmentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#merge_capacity_commitments ReservationService.MergeCapacityCommitments}. + # @!attribute [rw] parent + # @return [::String] + # Parent resource that identifies admin project and location e.g., + # `projects/myproject/locations/us` + # @!attribute [rw] capacity_commitment_ids + # @return [::Array<::String>] + # Ids of capacity commitments to merge. + # These capacity commitments must exist under admin project and location + # specified in the parent. + # ID is the last portion of capacity commitment name e.g., 'abc' for + # projects/myproject/locations/US/capacityCommitments/abc + # @!attribute [rw] capacity_commitment_id + # @return [::String] + # Optional. The optional resulting capacity commitment ID. Capacity + # commitment name will be generated automatically if this field is empty. + # This field must only contain lower case alphanumeric characters or dashes. + # The first and last character cannot be a dash. Max length is 64 characters. + class MergeCapacityCommitmentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An assignment allows a project to submit jobs + # of a certain type using slots from the specified reservation. + # @!attribute [r] name + # @return [::String] + # Output only. Name of the resource. E.g.: + # `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. + # The assignment_id must only contain lower case alphanumeric characters or + # dashes and the max length is 64 characters. + # @!attribute [rw] assignee + # @return [::String] + # Optional. The resource which will use the reservation. E.g. + # `projects/myproject`, `folders/123`, or `organizations/456`. + # @!attribute [rw] job_type + # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment::JobType] + # Optional. Which type of jobs will use the reservation. + # @!attribute [r] state + # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment::State] + # Output only. State of the assignment. + # @!attribute [rw] enable_gemini_in_bigquery + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. Deprecated: "Gemini in BigQuery" is now available by + # default for all BigQuery editions and should not be explicitly set. + # Controls if "Gemini in BigQuery" + # (https://cloud.google.com/gemini/docs/bigquery/overview) features should be + # enabled for this reservation assignment. + # @!attribute [rw] scheduling_policy + # @return [::Google::Cloud::Bigquery::Reservation::V1::SchedulingPolicy] + # Optional. The scheduling policy to use for jobs and queries of this + # assignee when running under the associated reservation. The scheduling + # policy controls how the reservation's resources are distributed. This + # overrides the default scheduling policy specified on the reservation. + # + # This feature is not yet generally available. + class Assignment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Types of job, which could be specified when using the reservation. + module JobType + # Invalid type. Requests with this value will be rejected with + # error code `google.rpc.Code.INVALID_ARGUMENT`. + JOB_TYPE_UNSPECIFIED = 0 + + # Pipeline (load/export) jobs from the project will use the reservation. + PIPELINE = 1 + + # Query jobs from the project will use the reservation. + QUERY = 2 + + # BigQuery ML jobs that use services external to BigQuery for model + # training. These jobs will not utilize idle slots from other reservations. + ML_EXTERNAL = 3 + + # Background jobs that BigQuery runs for the customers in the background. + BACKGROUND = 4 + + # Continuous SQL jobs will use this reservation. Reservations with + # continuous assignments cannot be mixed with non-continuous assignments. + CONTINUOUS = 6 + + # Finer granularity background jobs for capturing changes in a source + # database and streaming them into BigQuery. Reservations with this job + # type take priority over a default BACKGROUND reservation assignment (if + # it exists). + BACKGROUND_CHANGE_DATA_CAPTURE = 7 + + # Finer granularity background jobs for refreshing cached metadata for + # BigQuery tables. Reservations with this job type take priority over a + # default BACKGROUND reservation assignment (if it exists). + BACKGROUND_COLUMN_METADATA_INDEX = 8 + + # Finer granularity background jobs for refreshing search indexes upon + # BigQuery table columns. Reservations with this job type + # take priority over a default BACKGROUND reservation assignment (if it + # exists). + BACKGROUND_SEARCH_INDEX_REFRESH = 9 + end + + # Assignment will remain in PENDING state if no active capacity commitment is + # present. It will become ACTIVE when some capacity commitment becomes + # active. + module State + # Invalid state value. + STATE_UNSPECIFIED = 0 + + # Queries from assignee will be executed as on-demand, if related + # assignment is pending. + PENDING = 1 + + # Assignment is ready. + ACTIVE = 2 + end + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_assignment ReservationService.CreateAssignment}. + # Note: "bigquery.reservationAssignments.create" permission is required on the + # related assignee. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name of the assignment + # E.g. `projects/myproject/locations/US/reservations/team1-prod` + # @!attribute [rw] assignment + # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # Assignment resource to create. + # @!attribute [rw] assignment_id + # @return [::String] + # The optional assignment ID. Assignment name will be generated automatically + # if this field is empty. + # This field must only contain lower case alphanumeric characters or dashes. + # Max length is 64 characters. + class CreateAssignmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_assignments ReservationService.ListAssignments}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name e.g.: + # + # `projects/myproject/locations/US/reservations/team1-prod` + # + # Or: + # + # `projects/myproject/locations/US/reservations/-` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return per page. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous List request, if any. + class ListAssignmentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_assignments ReservationService.ListAssignments}. + # @!attribute [rw] assignments + # @return [::Array<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] + # List of assignments visible to the user. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListAssignmentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_assignment ReservationService.DeleteAssignment}. + # Note: "bigquery.reservationAssignments.delete" permission is required on the + # related assignee. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource, e.g. + # `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + class DeleteAssignmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_assignments ReservationService.SearchAssignments}. + # Note: "bigquery.reservationAssignments.search" permission is required on the + # related assignee. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the admin project(containing project and + # location), e.g.: + # `projects/myproject/locations/US`. + # @!attribute [rw] query + # @return [::String] + # Please specify resource name as assignee in the query. + # + # Examples: + # + # * `assignee=projects/myproject` + # * `assignee=folders/123` + # * `assignee=organizations/456` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return per page. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous List request, if any. + class SearchAssignmentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_all_assignments ReservationService.SearchAllAssignments}. + # Note: "bigquery.reservationAssignments.search" permission is required on the + # related assignee. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name with location (project name could be the + # wildcard '-'), e.g.: + # `projects/-/locations/US`. + # @!attribute [rw] query + # @return [::String] + # Please specify resource name as assignee in the query. + # + # Examples: + # + # * `assignee=projects/myproject` + # * `assignee=folders/123` + # * `assignee=organizations/456` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return per page. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous List request, if any. + class SearchAllAssignmentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_assignments ReservationService.SearchAssignments}. + # @!attribute [rw] assignments + # @return [::Array<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] + # List of assignments visible to the user. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class SearchAssignmentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_all_assignments ReservationService.SearchAllAssignments}. + # @!attribute [rw] assignments + # @return [::Array<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] + # List of assignments visible to the user. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class SearchAllAssignmentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#move_assignment ReservationService.MoveAssignment}. + # + # **Note**: "bigquery.reservationAssignments.create" permission is required on + # the destination_id. + # + # **Note**: "bigquery.reservationAssignments.create" and + # "bigquery.reservationAssignments.delete" permission are required on the + # related assignee. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the assignment, + # e.g. + # `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + # @!attribute [rw] destination_id + # @return [::String] + # The new reservation ID, e.g.: + # `projects/myotherproject/locations/US/reservations/team2-prod` + # @!attribute [rw] assignment_id + # @return [::String] + # The optional assignment ID. A new assignment name is generated if this + # field is empty. + # + # This field can contain only lowercase alphanumeric characters or dashes. + # Max length is 64 characters. + class MoveAssignmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for + # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_assignment ReservationService.UpdateAssignment}. + # @!attribute [rw] assignment + # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] + # Content of the assignment to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Standard field mask for the set of fields to be updated. + class UpdateAssignmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Fully qualified reference to BigQuery table. + # Internally stored as google.cloud.bi.v1.BqTableReference. + # @!attribute [rw] project_id + # @return [::String] + # Optional. The assigned project ID of the project. + # @!attribute [rw] dataset_id + # @return [::String] + # Optional. The ID of the dataset in the above project. + # @!attribute [rw] table_id + # @return [::String] + # Optional. The ID of the table in the above dataset. + class TableReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a BI Reservation. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the singleton BI reservation. + # Reservation names have the form + # `projects/{project_id}/locations/{location_id}/biReservation`. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last update timestamp of a reservation. + # @!attribute [rw] size + # @return [::Integer] + # Optional. Size of a reservation, in bytes. + # @!attribute [rw] preferred_tables + # @return [::Array<::Google::Cloud::Bigquery::Reservation::V1::TableReference>] + # Optional. Preferred tables to use BI capacity for. + class BiReservation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to get a singleton BI reservation. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the requested reservation, for example: + # `projects/{project_id}/locations/{location_id}/biReservation` + class GetBiReservationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to update a BI reservation. + # @!attribute [rw] bi_reservation + # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] + # A reservation to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # A list of fields to be updated in this request. + class UpdateBiReservationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of editions. + # Different features and behaviors are provided to different editions + # Capacity commitments and reservations are linked to editions. + module Edition + # Default value, which will be treated as ENTERPRISE. + EDITION_UNSPECIFIED = 0 + + # Standard edition. + STANDARD = 1 + + # Enterprise edition. + ENTERPRISE = 2 + + # Enterprise Plus edition. + ENTERPRISE_PLUS = 3 + end + + # The failover mode when a user initiates a failover on a reservation + # determines how writes that are pending replication are handled after the + # failover is initiated. + module FailoverMode + # Invalid value. + FAILOVER_MODE_UNSPECIFIED = 0 + + # When customers initiate a soft failover, BigQuery will wait until all + # committed writes are replicated to the secondary. This mode requires both + # regions to be available for the failover to succeed and prevents data loss. + SOFT = 1 + + # When customers initiate a hard failover, BigQuery will not wait until all + # committed writes are replicated to the secondary. There can be data loss + # for hard failover. + HARD = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..fbee4c39d435 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..848f8c2f7895 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..79fdbd1e2eff --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..9e9bdbb09ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..341efa296c29 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..c2acab1235a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..ad3c3ad25f0f --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..a005f395ccab --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..3f61f95b2587 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..9505eeb8657e --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/Gemfile new file mode 100644 index 000000000000..5c580f596f83 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-bigquery-reservation-v1", path: "../" +else + gem "google-cloud-bigquery-reservation-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-bigquery-reservation-v1/snippets/reservation_service/create_assignment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_assignment.rb new file mode 100644 index 000000000000..ae55a1a64f97 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_assignment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_CreateAssignment_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the create_assignment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#create_assignment. +# +def create_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new + + # Call the create_assignment method. + result = client.create_assignment request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_CreateAssignment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_capacity_commitment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_capacity_commitment.rb new file mode 100644 index 000000000000..45696eb75614 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_capacity_commitment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the create_capacity_commitment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#create_capacity_commitment. +# +def create_capacity_commitment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new + + # Call the create_capacity_commitment method. + result = client.create_capacity_commitment request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation.rb new file mode 100644 index 000000000000..f654b0aafd72 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_CreateReservation_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the create_reservation call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#create_reservation. +# +def create_reservation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new + + # Call the create_reservation method. + result = client.create_reservation request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_CreateReservation_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation_group.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation_group.rb new file mode 100644 index 000000000000..2798b7b6821c --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation_group.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_CreateReservationGroup_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the create_reservation_group call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#create_reservation_group. +# +def create_reservation_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest.new + + # Call the create_reservation_group method. + result = client.create_reservation_group request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_CreateReservationGroup_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_assignment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_assignment.rb new file mode 100644 index 000000000000..2c69e562d345 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_assignment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the delete_assignment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#delete_assignment. +# +def delete_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new + + # Call the delete_assignment method. + result = client.delete_assignment request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_capacity_commitment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_capacity_commitment.rb new file mode 100644 index 000000000000..009e37d621a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_capacity_commitment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the delete_capacity_commitment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#delete_capacity_commitment. +# +def delete_capacity_commitment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new + + # Call the delete_capacity_commitment method. + result = client.delete_capacity_commitment request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation.rb new file mode 100644 index 000000000000..0bccc4f64480 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_DeleteReservation_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the delete_reservation call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation. +# +def delete_reservation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new + + # Call the delete_reservation method. + result = client.delete_reservation request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_DeleteReservation_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation_group.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation_group.rb new file mode 100644 index 000000000000..b54f2a5229b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation_group.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_DeleteReservationGroup_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the delete_reservation_group call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation_group. +# +def delete_reservation_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest.new + + # Call the delete_reservation_group method. + result = client.delete_reservation_group request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_DeleteReservationGroup_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/failover_reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/failover_reservation.rb new file mode 100644 index 000000000000..828530c74a80 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/failover_reservation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_FailoverReservation_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the failover_reservation call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#failover_reservation. +# +def failover_reservation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest.new + + # Call the failover_reservation method. + result = client.failover_reservation request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_FailoverReservation_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_bi_reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_bi_reservation.rb new file mode 100644 index 000000000000..e8bc86c411d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_bi_reservation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_GetBiReservation_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the get_bi_reservation call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#get_bi_reservation. +# +def get_bi_reservation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new + + # Call the get_bi_reservation method. + result = client.get_bi_reservation request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_GetBiReservation_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_capacity_commitment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_capacity_commitment.rb new file mode 100644 index 000000000000..1eda6f799ad4 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_capacity_commitment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the get_capacity_commitment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#get_capacity_commitment. +# +def get_capacity_commitment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new + + # Call the get_capacity_commitment method. + result = client.get_capacity_commitment request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_iam_policy.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_iam_policy.rb new file mode 100644 index 000000000000..e6b4fb3c22d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_GetIamPolicy_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the get_iam_policy call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation.rb new file mode 100644 index 000000000000..da8259b65e0e --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_GetReservation_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the get_reservation call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#get_reservation. +# +def get_reservation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new + + # Call the get_reservation method. + result = client.get_reservation request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_GetReservation_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation_group.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation_group.rb new file mode 100644 index 000000000000..8d3a33dc524f --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation_group.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_GetReservationGroup_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the get_reservation_group call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#get_reservation_group. +# +def get_reservation_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest.new + + # Call the get_reservation_group method. + result = client.get_reservation_group request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_GetReservationGroup_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_assignments.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_assignments.rb new file mode 100644 index 000000000000..2f2ca7bb8ef2 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_assignments.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_ListAssignments_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the list_assignments call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#list_assignments. +# +def list_assignments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new + + # Call the list_assignments method. + result = client.list_assignments request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. + p item + end +end +# [END bigqueryreservation_v1_generated_ReservationService_ListAssignments_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_capacity_commitments.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_capacity_commitments.rb new file mode 100644 index 000000000000..b04fd4449845 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_capacity_commitments.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the list_capacity_commitments call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#list_capacity_commitments. +# +def list_capacity_commitments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new + + # Call the list_capacity_commitments method. + result = client.list_capacity_commitments request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + p item + end +end +# [END bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservation_groups.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservation_groups.rb new file mode 100644 index 000000000000..473939033c10 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservation_groups.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_ListReservationGroups_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the list_reservation_groups call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#list_reservation_groups. +# +def list_reservation_groups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest.new + + # Call the list_reservation_groups method. + result = client.list_reservation_groups request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. + p item + end +end +# [END bigqueryreservation_v1_generated_ReservationService_ListReservationGroups_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservations.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservations.rb new file mode 100644 index 000000000000..97d0f0dcb499 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservations.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_ListReservations_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the list_reservations call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#list_reservations. +# +def list_reservations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new + + # Call the list_reservations method. + result = client.list_reservations request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Reservation. + p item + end +end +# [END bigqueryreservation_v1_generated_ReservationService_ListReservations_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/merge_capacity_commitments.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/merge_capacity_commitments.rb new file mode 100644 index 000000000000..ed89db273627 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/merge_capacity_commitments.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the merge_capacity_commitments call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#merge_capacity_commitments. +# +def merge_capacity_commitments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new + + # Call the merge_capacity_commitments method. + result = client.merge_capacity_commitments request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/move_assignment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/move_assignment.rb new file mode 100644 index 000000000000..83406d3ef306 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/move_assignment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_MoveAssignment_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the move_assignment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#move_assignment. +# +def move_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new + + # Call the move_assignment method. + result = client.move_assignment request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_MoveAssignment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_all_assignments.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_all_assignments.rb new file mode 100644 index 000000000000..5110e9672304 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_all_assignments.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the search_all_assignments call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#search_all_assignments. +# +def search_all_assignments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new + + # Call the search_all_assignments method. + result = client.search_all_assignments request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. + p item + end +end +# [END bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_assignments.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_assignments.rb new file mode 100644 index 000000000000..7da77cab8f59 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_assignments.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_SearchAssignments_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the search_assignments call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#search_assignments. +# +def search_assignments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new + + # Call the search_assignments method. + result = client.search_assignments request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. + p item + end +end +# [END bigqueryreservation_v1_generated_ReservationService_SearchAssignments_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/set_iam_policy.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/set_iam_policy.rb new file mode 100644 index 000000000000..4dc12130d309 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_SetIamPolicy_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the set_iam_policy call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/split_capacity_commitment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/split_capacity_commitment.rb new file mode 100644 index 000000000000..888a9d9dbb8a --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/split_capacity_commitment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the split_capacity_commitment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#split_capacity_commitment. +# +def split_capacity_commitment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new + + # Call the split_capacity_commitment method. + result = client.split_capacity_commitment request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/test_iam_permissions.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/test_iam_permissions.rb new file mode 100644 index 000000000000..2b711103c270 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_TestIamPermissions_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the test_iam_permissions call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_assignment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_assignment.rb new file mode 100644 index 000000000000..5a0628a6de21 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_assignment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the update_assignment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#update_assignment. +# +def update_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new + + # Call the update_assignment method. + result = client.update_assignment request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_bi_reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_bi_reservation.rb new file mode 100644 index 000000000000..5d5266c844b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_bi_reservation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the update_bi_reservation call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#update_bi_reservation. +# +def update_bi_reservation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new + + # Call the update_bi_reservation method. + result = client.update_bi_reservation request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_capacity_commitment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_capacity_commitment.rb new file mode 100644 index 000000000000..1ec52bd3ddd3 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_capacity_commitment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the update_capacity_commitment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#update_capacity_commitment. +# +def update_capacity_commitment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new + + # Call the update_capacity_commitment method. + result = client.update_capacity_commitment request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_reservation.rb new file mode 100644 index 000000000000..b3bc6f6648ac --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_reservation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START bigqueryreservation_v1_generated_ReservationService_UpdateReservation_sync] +require "google/cloud/bigquery/reservation/v1" + +## +# Snippet for the update_reservation call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#update_reservation. +# +def update_reservation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new + + # Call the update_reservation method. + result = client.update_reservation request + + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. + p result +end +# [END bigqueryreservation_v1_generated_ReservationService_UpdateReservation_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/snippet_metadata_google.cloud.bigquery.reservation.v1.json b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/snippet_metadata_google.cloud.bigquery.reservation.v1.json new file mode 100644 index 000000000000..9c975b868826 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/snippet_metadata_google.cloud.bigquery.reservation.v1.json @@ -0,0 +1,1175 @@ +{ + "client_library": { + "name": "google-cloud-bigquery-reservation-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.bigquery.reservation.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_CreateReservation_sync", + "title": "Snippet for the create_reservation call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_reservation.", + "file": "reservation_service/create_reservation.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_reservation", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_reservation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::Reservation", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "CreateReservation", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_ListReservations_sync", + "title": "Snippet for the list_reservations call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservations.", + "file": "reservation_service/list_reservations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_reservations", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::ListReservationsResponse", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "ListReservations", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.ListReservations", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_GetReservation_sync", + "title": "Snippet for the get_reservation call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_reservation.", + "file": "reservation_service/get_reservation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_reservation", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_reservation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::Reservation", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "GetReservation", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.GetReservation", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_DeleteReservation_sync", + "title": "Snippet for the delete_reservation call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation.", + "file": "reservation_service/delete_reservation.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_reservation", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "DeleteReservation", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_UpdateReservation_sync", + "title": "Snippet for the update_reservation call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_reservation.", + "file": "reservation_service/update_reservation.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_reservation", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_reservation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::Reservation", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "UpdateReservation", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_FailoverReservation_sync", + "title": "Snippet for the failover_reservation call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#failover_reservation.", + "file": "reservation_service/failover_reservation.rb", + "language": "RUBY", + "client_method": { + "short_name": "failover_reservation", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#failover_reservation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::Reservation", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "FailoverReservation", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.FailoverReservation", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_sync", + "title": "Snippet for the create_capacity_commitment call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_capacity_commitment.", + "file": "reservation_service/create_capacity_commitment.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_capacity_commitment", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_capacity_commitment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "CreateCapacityCommitment", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_sync", + "title": "Snippet for the list_capacity_commitments call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_capacity_commitments.", + "file": "reservation_service/list_capacity_commitments.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_capacity_commitments", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_capacity_commitments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "ListCapacityCommitments", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_sync", + "title": "Snippet for the get_capacity_commitment call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_capacity_commitment.", + "file": "reservation_service/get_capacity_commitment.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_capacity_commitment", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_capacity_commitment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "GetCapacityCommitment", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_sync", + "title": "Snippet for the delete_capacity_commitment call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_capacity_commitment.", + "file": "reservation_service/delete_capacity_commitment.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_capacity_commitment", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_capacity_commitment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "DeleteCapacityCommitment", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_sync", + "title": "Snippet for the update_capacity_commitment call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_capacity_commitment.", + "file": "reservation_service/update_capacity_commitment.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_capacity_commitment", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_capacity_commitment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "UpdateCapacityCommitment", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_sync", + "title": "Snippet for the split_capacity_commitment call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#split_capacity_commitment.", + "file": "reservation_service/split_capacity_commitment.rb", + "language": "RUBY", + "client_method": { + "short_name": "split_capacity_commitment", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#split_capacity_commitment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "SplitCapacityCommitment", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_sync", + "title": "Snippet for the merge_capacity_commitments call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#merge_capacity_commitments.", + "file": "reservation_service/merge_capacity_commitments.rb", + "language": "RUBY", + "client_method": { + "short_name": "merge_capacity_commitments", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#merge_capacity_commitments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "MergeCapacityCommitments", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_CreateAssignment_sync", + "title": "Snippet for the create_assignment call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_assignment.", + "file": "reservation_service/create_assignment.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_assignment", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_assignment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::Assignment", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "CreateAssignment", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_ListAssignments_sync", + "title": "Snippet for the list_assignments call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_assignments.", + "file": "reservation_service/list_assignments.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_assignments", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_assignments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsResponse", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "ListAssignments", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_sync", + "title": "Snippet for the delete_assignment call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_assignment.", + "file": "reservation_service/delete_assignment.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_assignment", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_assignment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "DeleteAssignment", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_SearchAssignments_sync", + "title": "Snippet for the search_assignments call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_assignments.", + "file": "reservation_service/search_assignments.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_assignments", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_assignments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsResponse", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "SearchAssignments", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_sync", + "title": "Snippet for the search_all_assignments call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_all_assignments.", + "file": "reservation_service/search_all_assignments.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_all_assignments", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_all_assignments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsResponse", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "SearchAllAssignments", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_MoveAssignment_sync", + "title": "Snippet for the move_assignment call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#move_assignment.", + "file": "reservation_service/move_assignment.rb", + "language": "RUBY", + "client_method": { + "short_name": "move_assignment", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#move_assignment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::Assignment", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "MoveAssignment", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_sync", + "title": "Snippet for the update_assignment call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_assignment.", + "file": "reservation_service/update_assignment.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_assignment", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_assignment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::Assignment", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "UpdateAssignment", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignment", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_GetBiReservation_sync", + "title": "Snippet for the get_bi_reservation call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_bi_reservation.", + "file": "reservation_service/get_bi_reservation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_bi_reservation", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_bi_reservation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::BiReservation", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "GetBiReservation", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.GetBiReservation", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_sync", + "title": "Snippet for the update_bi_reservation call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_bi_reservation.", + "file": "reservation_service/update_bi_reservation.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_bi_reservation", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_bi_reservation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::BiReservation", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "UpdateBiReservation", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateBiReservation", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_iam_policy.", + "file": "reservation_service/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.GetIamPolicy", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#set_iam_policy.", + "file": "reservation_service/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.SetIamPolicy", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#test_iam_permissions.", + "file": "reservation_service/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.TestIamPermissions", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_CreateReservationGroup_sync", + "title": "Snippet for the create_reservation_group call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_reservation_group.", + "file": "reservation_service/create_reservation_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_reservation_group", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_reservation_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "CreateReservationGroup", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.CreateReservationGroup", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_GetReservationGroup_sync", + "title": "Snippet for the get_reservation_group call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_reservation_group.", + "file": "reservation_service/get_reservation_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_reservation_group", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_reservation_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "GetReservationGroup", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.GetReservationGroup", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_DeleteReservationGroup_sync", + "title": "Snippet for the delete_reservation_group call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation_group.", + "file": "reservation_service/delete_reservation_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_reservation_group", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "DeleteReservationGroup", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservationGroup", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "bigqueryreservation_v1_generated_ReservationService_ListReservationGroups_sync", + "title": "Snippet for the list_reservation_groups call in the ReservationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservation_groups.", + "file": "reservation_service/list_reservation_groups.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_reservation_groups", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservation_groups", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsResponse", + "client": { + "short_name": "ReservationService::Client", + "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" + }, + "method": { + "short_name": "ListReservationGroups", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.ListReservationGroups", + "service": { + "short_name": "ReservationService", + "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_paths_test.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_paths_test.rb new file mode 100644 index 000000000000..90254c913892 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_paths_test.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/bigquery/reservation/v1/reservation_service" + +class ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_assignment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.assignment_path project: "value0", location: "value1", reservation: "value2", assignment: "value3" + assert_equal "projects/value0/locations/value1/reservations/value2/assignments/value3", path + end + end + + def test_bi_reservation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.bi_reservation_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/biReservation", path + end + end + + def test_capacity_commitment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.capacity_commitment_path project: "value0", location: "value1", capacity_commitment: "value2" + assert_equal "projects/value0/locations/value1/capacityCommitments/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_reservation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.reservation_path project: "value0", location: "value1", reservation: "value2" + assert_equal "projects/value0/locations/value1/reservations/value2", path + end + end + + def test_reservation_group_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.reservation_group_path project: "value0", location: "value1", reservation_group: "value2" + assert_equal "projects/value0/locations/value1/reservationGroups/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_rest_test.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_rest_test.rb new file mode 100644 index 000000000000..9b5d5402acc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_rest_test.rb @@ -0,0 +1,1703 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/bigquery/reservation/v1/reservation_pb" +require "google/cloud/bigquery/reservation/v1/reservation_service/rest" + + +class ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_reservation + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + reservation_id = "hello world" + reservation = {} + + create_reservation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_create_reservation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_reservation_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_reservation({ parent: parent, reservation_id: reservation_id, reservation: reservation }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_reservation parent: parent, reservation_id: reservation_id, reservation: reservation do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_reservation ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new(parent: parent, reservation_id: reservation_id, reservation: reservation) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_reservation({ parent: parent, reservation_id: reservation_id, reservation: reservation }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_reservation(::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new(parent: parent, reservation_id: reservation_id, reservation: reservation), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_reservation_client_stub.call_count + end + end + end + + def test_list_reservations + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_reservations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_list_reservations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_reservations_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_reservations({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_reservations parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_reservations ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_reservations({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_reservations(::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_reservations_client_stub.call_count + end + end + end + + def test_get_reservation + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_reservation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_get_reservation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_reservation_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_reservation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_reservation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_reservation ::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_reservation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_reservation(::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_reservation_client_stub.call_count + end + end + end + + def test_delete_reservation + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_reservation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_delete_reservation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_reservation_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_reservation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_reservation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_reservation ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_reservation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_reservation(::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_reservation_client_stub.call_count + end + end + end + + def test_update_reservation + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + reservation = {} + update_mask = {} + + update_reservation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_update_reservation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_reservation_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_reservation({ reservation: reservation, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_reservation reservation: reservation, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_reservation ::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new(reservation: reservation, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_reservation({ reservation: reservation, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_reservation(::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new(reservation: reservation, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_reservation_client_stub.call_count + end + end + end + + def test_failover_reservation + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + failover_mode = :FAILOVER_MODE_UNSPECIFIED + + failover_reservation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_failover_reservation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, failover_reservation_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.failover_reservation({ name: name, failover_mode: failover_mode }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.failover_reservation name: name, failover_mode: failover_mode do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.failover_reservation ::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest.new(name: name, failover_mode: failover_mode) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.failover_reservation({ name: name, failover_mode: failover_mode }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.failover_reservation(::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest.new(name: name, failover_mode: failover_mode), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, failover_reservation_client_stub.call_count + end + end + end + + def test_create_capacity_commitment + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + capacity_commitment = {} + enforce_single_admin_project_per_org = true + capacity_commitment_id = "hello world" + + create_capacity_commitment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_create_capacity_commitment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_capacity_commitment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_capacity_commitment({ parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_capacity_commitment parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new(parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_capacity_commitment({ parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new(parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_capacity_commitment_client_stub.call_count + end + end + end + + def test_list_capacity_commitments + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_capacity_commitments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_list_capacity_commitments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_capacity_commitments_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_capacity_commitments({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_capacity_commitments parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_capacity_commitments ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_capacity_commitments({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_capacity_commitments(::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_capacity_commitments_client_stub.call_count + end + end + end + + def test_get_capacity_commitment + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_capacity_commitment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_get_capacity_commitment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_capacity_commitment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_capacity_commitment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_capacity_commitment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_capacity_commitment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_capacity_commitment_client_stub.call_count + end + end + end + + def test_delete_capacity_commitment + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + force = true + + delete_capacity_commitment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_delete_capacity_commitment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_capacity_commitment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_capacity_commitment({ name: name, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_capacity_commitment name: name, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new(name: name, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_capacity_commitment({ name: name, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new(name: name, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_capacity_commitment_client_stub.call_count + end + end + end + + def test_update_capacity_commitment + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + capacity_commitment = {} + update_mask = {} + + update_capacity_commitment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_update_capacity_commitment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_capacity_commitment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_capacity_commitment({ capacity_commitment: capacity_commitment, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_capacity_commitment capacity_commitment: capacity_commitment, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new(capacity_commitment: capacity_commitment, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_capacity_commitment({ capacity_commitment: capacity_commitment, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new(capacity_commitment: capacity_commitment, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_capacity_commitment_client_stub.call_count + end + end + end + + def test_split_capacity_commitment + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + slot_count = 42 + + split_capacity_commitment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_split_capacity_commitment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, split_capacity_commitment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.split_capacity_commitment({ name: name, slot_count: slot_count }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.split_capacity_commitment name: name, slot_count: slot_count do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.split_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new(name: name, slot_count: slot_count) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.split_capacity_commitment({ name: name, slot_count: slot_count }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.split_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new(name: name, slot_count: slot_count), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, split_capacity_commitment_client_stub.call_count + end + end + end + + def test_merge_capacity_commitments + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + capacity_commitment_ids = ["hello world"] + capacity_commitment_id = "hello world" + + merge_capacity_commitments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_merge_capacity_commitments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, merge_capacity_commitments_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.merge_capacity_commitments({ parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.merge_capacity_commitments parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.merge_capacity_commitments ::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new(parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.merge_capacity_commitments({ parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.merge_capacity_commitments(::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new(parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, merge_capacity_commitments_client_stub.call_count + end + end + end + + def test_create_assignment + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + assignment = {} + assignment_id = "hello world" + + create_assignment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_create_assignment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_assignment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_assignment({ parent: parent, assignment: assignment, assignment_id: assignment_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_assignment parent: parent, assignment: assignment, assignment_id: assignment_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_assignment ::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new(parent: parent, assignment: assignment, assignment_id: assignment_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_assignment({ parent: parent, assignment: assignment, assignment_id: assignment_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_assignment(::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new(parent: parent, assignment: assignment, assignment_id: assignment_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_assignment_client_stub.call_count + end + end + end + + def test_list_assignments + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_assignments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_list_assignments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_assignments_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_assignments({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_assignments parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_assignments ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_assignments({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_assignments(::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_assignments_client_stub.call_count + end + end + end + + def test_delete_assignment + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_assignment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_delete_assignment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_assignment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_assignment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_assignment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_assignment ::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_assignment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_assignment(::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_assignment_client_stub.call_count + end + end + end + + def test_search_assignments + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_assignments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_search_assignments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_assignments_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_assignments parent: parent, query: query, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_assignments ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_assignments(::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_assignments_client_stub.call_count + end + end + end + + def test_search_all_assignments + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_all_assignments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_search_all_assignments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_all_assignments_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_all_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_all_assignments parent: parent, query: query, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_all_assignments ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_all_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_all_assignments(::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_all_assignments_client_stub.call_count + end + end + end + + def test_move_assignment + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + destination_id = "hello world" + assignment_id = "hello world" + + move_assignment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_move_assignment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, move_assignment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.move_assignment({ name: name, destination_id: destination_id, assignment_id: assignment_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.move_assignment name: name, destination_id: destination_id, assignment_id: assignment_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.move_assignment ::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new(name: name, destination_id: destination_id, assignment_id: assignment_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.move_assignment({ name: name, destination_id: destination_id, assignment_id: assignment_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.move_assignment(::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new(name: name, destination_id: destination_id, assignment_id: assignment_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, move_assignment_client_stub.call_count + end + end + end + + def test_update_assignment + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + assignment = {} + update_mask = {} + + update_assignment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_update_assignment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_assignment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_assignment({ assignment: assignment, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_assignment assignment: assignment, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_assignment ::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new(assignment: assignment, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_assignment({ assignment: assignment, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_assignment(::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new(assignment: assignment, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_assignment_client_stub.call_count + end + end + end + + def test_get_bi_reservation + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::BiReservation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_bi_reservation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_get_bi_reservation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_bi_reservation_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_bi_reservation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_bi_reservation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_bi_reservation ::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_bi_reservation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_bi_reservation(::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_bi_reservation_client_stub.call_count + end + end + end + + def test_update_bi_reservation + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::BiReservation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + bi_reservation = {} + update_mask = {} + + update_bi_reservation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_update_bi_reservation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_bi_reservation_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_bi_reservation({ bi_reservation: bi_reservation, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_bi_reservation bi_reservation: bi_reservation, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_bi_reservation ::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new(bi_reservation: bi_reservation, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_bi_reservation({ bi_reservation: bi_reservation, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_bi_reservation(::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new(bi_reservation: bi_reservation, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_bi_reservation_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_create_reservation_group + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + reservation_group_id = "hello world" + reservation_group = {} + + create_reservation_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_create_reservation_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_reservation_group_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_reservation_group({ parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_reservation_group parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_reservation_group ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest.new(parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_reservation_group({ parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_reservation_group(::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest.new(parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_reservation_group_client_stub.call_count + end + end + end + + def test_get_reservation_group + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_reservation_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_get_reservation_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_reservation_group_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_reservation_group({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_reservation_group name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_reservation_group ::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_reservation_group({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_reservation_group(::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_reservation_group_client_stub.call_count + end + end + end + + def test_delete_reservation_group + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_reservation_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_delete_reservation_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_reservation_group_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_reservation_group({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_reservation_group name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_reservation_group ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_reservation_group({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_reservation_group(::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_reservation_group_client_stub.call_count + end + end + end + + def test_list_reservation_groups + # Create test objects. + client_result = ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_reservation_groups_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_list_reservation_groups_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_reservation_groups_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_reservation_groups({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_reservation_groups parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_reservation_groups ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_reservation_groups({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_reservation_groups(::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_reservation_groups_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::Bigquery::Reservation::V1::ReservationService::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::Bigquery::Reservation::V1::ReservationService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_test.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_test.rb new file mode 100644 index 000000000000..0c4849ffddd6 --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_test.rb @@ -0,0 +1,1892 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/bigquery/reservation/v1/reservation_pb" +require "google/cloud/bigquery/reservation/v1/reservation_service" + +class ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_reservation + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + reservation_id = "hello world" + reservation = {} + + create_reservation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_reservation, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["reservation_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::Reservation), request["reservation"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_reservation_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_reservation({ parent: parent, reservation_id: reservation_id, reservation: reservation }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_reservation parent: parent, reservation_id: reservation_id, reservation: reservation do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_reservation ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new(parent: parent, reservation_id: reservation_id, reservation: reservation) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_reservation({ parent: parent, reservation_id: reservation_id, reservation: reservation }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_reservation(::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new(parent: parent, reservation_id: reservation_id, reservation: reservation), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_reservation_client_stub.call_rpc_count + end + end + + def test_list_reservations + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_reservations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_reservations, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_reservations_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_reservations({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_reservations parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_reservations ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_reservations({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_reservations(::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_reservations_client_stub.call_rpc_count + end + end + + def test_get_reservation + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_reservation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_reservation, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_reservation_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_reservation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_reservation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_reservation ::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_reservation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_reservation(::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_reservation_client_stub.call_rpc_count + end + end + + def test_delete_reservation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_reservation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_reservation, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_reservation_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_reservation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_reservation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_reservation ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_reservation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_reservation(::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_reservation_client_stub.call_rpc_count + end + end + + def test_update_reservation + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.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. + reservation = {} + update_mask = {} + + update_reservation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_reservation, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::Reservation), request["reservation"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_reservation_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_reservation({ reservation: reservation, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_reservation reservation: reservation, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_reservation ::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new(reservation: reservation, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_reservation({ reservation: reservation, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_reservation(::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new(reservation: reservation, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_reservation_client_stub.call_rpc_count + end + end + + def test_failover_reservation + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + failover_mode = :FAILOVER_MODE_UNSPECIFIED + + failover_reservation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :failover_reservation, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest, request + assert_equal "hello world", request["name"] + assert_equal :FAILOVER_MODE_UNSPECIFIED, request["failover_mode"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, failover_reservation_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.failover_reservation({ name: name, failover_mode: failover_mode }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.failover_reservation name: name, failover_mode: failover_mode do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.failover_reservation ::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest.new(name: name, failover_mode: failover_mode) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.failover_reservation({ name: name, failover_mode: failover_mode }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.failover_reservation(::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest.new(name: name, failover_mode: failover_mode), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, failover_reservation_client_stub.call_rpc_count + end + end + + def test_create_capacity_commitment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + capacity_commitment = {} + enforce_single_admin_project_per_org = true + capacity_commitment_id = "hello world" + + create_capacity_commitment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_capacity_commitment, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment), request["capacity_commitment"] + assert_equal true, request["enforce_single_admin_project_per_org"] + assert_equal "hello world", request["capacity_commitment_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_capacity_commitment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_capacity_commitment({ parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_capacity_commitment parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new(parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_capacity_commitment({ parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new(parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_capacity_commitment_client_stub.call_rpc_count + end + end + + def test_list_capacity_commitments + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_capacity_commitments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_capacity_commitments, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_capacity_commitments_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_capacity_commitments({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_capacity_commitments parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_capacity_commitments ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_capacity_commitments({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_capacity_commitments(::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_capacity_commitments_client_stub.call_rpc_count + end + end + + def test_get_capacity_commitment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_capacity_commitment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_capacity_commitment, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_capacity_commitment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_capacity_commitment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_capacity_commitment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_capacity_commitment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_capacity_commitment_client_stub.call_rpc_count + end + end + + def test_delete_capacity_commitment + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + force = true + + delete_capacity_commitment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_capacity_commitment, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_capacity_commitment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_capacity_commitment({ name: name, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_capacity_commitment name: name, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new(name: name, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_capacity_commitment({ name: name, force: force }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new(name: name, force: force), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_capacity_commitment_client_stub.call_rpc_count + end + end + + def test_update_capacity_commitment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.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. + capacity_commitment = {} + update_mask = {} + + update_capacity_commitment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_capacity_commitment, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment), request["capacity_commitment"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_capacity_commitment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_capacity_commitment({ capacity_commitment: capacity_commitment, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_capacity_commitment capacity_commitment: capacity_commitment, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new(capacity_commitment: capacity_commitment, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_capacity_commitment({ capacity_commitment: capacity_commitment, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new(capacity_commitment: capacity_commitment, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_capacity_commitment_client_stub.call_rpc_count + end + end + + def test_split_capacity_commitment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + slot_count = 42 + + split_capacity_commitment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :split_capacity_commitment, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["slot_count"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, split_capacity_commitment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.split_capacity_commitment({ name: name, slot_count: slot_count }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.split_capacity_commitment name: name, slot_count: slot_count do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.split_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new(name: name, slot_count: slot_count) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.split_capacity_commitment({ name: name, slot_count: slot_count }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.split_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new(name: name, slot_count: slot_count), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, split_capacity_commitment_client_stub.call_rpc_count + end + end + + def test_merge_capacity_commitments + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + capacity_commitment_ids = ["hello world"] + capacity_commitment_id = "hello world" + + merge_capacity_commitments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :merge_capacity_commitments, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["capacity_commitment_ids"] + assert_equal "hello world", request["capacity_commitment_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, merge_capacity_commitments_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.merge_capacity_commitments({ parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.merge_capacity_commitments parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.merge_capacity_commitments ::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new(parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.merge_capacity_commitments({ parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.merge_capacity_commitments(::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new(parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, merge_capacity_commitments_client_stub.call_rpc_count + end + end + + def test_create_assignment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + assignment = {} + assignment_id = "hello world" + + create_assignment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_assignment, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::Assignment), request["assignment"] + assert_equal "hello world", request["assignment_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_assignment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_assignment({ parent: parent, assignment: assignment, assignment_id: assignment_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_assignment parent: parent, assignment: assignment, assignment_id: assignment_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_assignment ::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new(parent: parent, assignment: assignment, assignment_id: assignment_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_assignment({ parent: parent, assignment: assignment, assignment_id: assignment_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_assignment(::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new(parent: parent, assignment: assignment, assignment_id: assignment_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_assignment_client_stub.call_rpc_count + end + end + + def test_list_assignments + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_assignments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_assignments, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_assignments_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_assignments({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_assignments parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_assignments ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_assignments({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_assignments(::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_assignments_client_stub.call_rpc_count + end + end + + def test_delete_assignment + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_assignment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_assignment, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_assignment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_assignment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_assignment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_assignment ::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_assignment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_assignment(::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_assignment_client_stub.call_rpc_count + end + end + + def test_search_assignments + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_assignments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_assignments, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["query"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_assignments_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_assignments parent: parent, query: query, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_assignments ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_assignments(::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_assignments_client_stub.call_rpc_count + end + end + + def test_search_all_assignments + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_all_assignments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_all_assignments, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["query"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_all_assignments_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_all_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_all_assignments parent: parent, query: query, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_all_assignments ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_all_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_all_assignments(::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_all_assignments_client_stub.call_rpc_count + end + end + + def test_move_assignment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + destination_id = "hello world" + assignment_id = "hello world" + + move_assignment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :move_assignment, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["destination_id"] + assert_equal "hello world", request["assignment_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, move_assignment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.move_assignment({ name: name, destination_id: destination_id, assignment_id: assignment_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.move_assignment name: name, destination_id: destination_id, assignment_id: assignment_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.move_assignment ::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new(name: name, destination_id: destination_id, assignment_id: assignment_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.move_assignment({ name: name, destination_id: destination_id, assignment_id: assignment_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.move_assignment(::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new(name: name, destination_id: destination_id, assignment_id: assignment_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, move_assignment_client_stub.call_rpc_count + end + end + + def test_update_assignment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.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. + assignment = {} + update_mask = {} + + update_assignment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_assignment, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::Assignment), request["assignment"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_assignment_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_assignment({ assignment: assignment, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_assignment assignment: assignment, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_assignment ::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new(assignment: assignment, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_assignment({ assignment: assignment, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_assignment(::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new(assignment: assignment, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_assignment_client_stub.call_rpc_count + end + end + + def test_get_bi_reservation + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::BiReservation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_bi_reservation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_bi_reservation, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_bi_reservation_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_bi_reservation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_bi_reservation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_bi_reservation ::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_bi_reservation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_bi_reservation(::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_bi_reservation_client_stub.call_rpc_count + end + end + + def test_update_bi_reservation + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::BiReservation.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. + bi_reservation = {} + update_mask = {} + + update_bi_reservation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_bi_reservation, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::BiReservation), request["bi_reservation"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_bi_reservation_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_bi_reservation({ bi_reservation: bi_reservation, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_bi_reservation bi_reservation: bi_reservation, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_bi_reservation ::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new(bi_reservation: bi_reservation, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_bi_reservation({ bi_reservation: bi_reservation, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_bi_reservation(::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new(bi_reservation: bi_reservation, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_bi_reservation_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_create_reservation_group + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + reservation_group_id = "hello world" + reservation_group = {} + + create_reservation_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_reservation_group, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["reservation_group_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup), request["reservation_group"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_reservation_group_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_reservation_group({ parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_reservation_group parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_reservation_group ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest.new(parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_reservation_group({ parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_reservation_group(::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest.new(parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_reservation_group_client_stub.call_rpc_count + end + end + + def test_get_reservation_group + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_reservation_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_reservation_group, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_reservation_group_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_reservation_group({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_reservation_group name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_reservation_group ::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_reservation_group({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_reservation_group(::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_reservation_group_client_stub.call_rpc_count + end + end + + def test_delete_reservation_group + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_reservation_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_reservation_group, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_reservation_group_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_reservation_group({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_reservation_group name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_reservation_group ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_reservation_group({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_reservation_group(::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_reservation_group_client_stub.call_rpc_count + end + end + + def test_list_reservation_groups + # Create GRPC objects. + grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_reservation_groups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_reservation_groups, name + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_reservation_groups_client_stub do + # Create client + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_reservation_groups({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_reservation_groups parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_reservation_groups ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_reservation_groups({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_reservation_groups(::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_reservation_groups_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::Bigquery::Reservation::V1::ReservationService::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::Bigquery::Reservation::V1::ReservationService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/helper.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/helper.rb new file mode 100644 index 000000000000..968201e8049d --- /dev/null +++ b/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From d37f33bd0b57959ca446754ea445bb0f8c4d8b1a Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 29 Dec 2025 22:09:25 +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 --- .../bigquery/reservation/v1/reservation_pb.rb | 2 +- .../bigquery/reservation/v1/reservation.rb | 12 +- .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 11 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 163 - ...ogle-cloud-bigquery-reservation-v1.gemspec | 29 - .../google-cloud-bigquery-reservation-v1.rb | 21 - .../google/cloud/bigquery/reservation/v1.rb | 47 - .../bigquery/reservation/v1/reservation_pb.rb | 106 - .../reservation/v1/reservation_service.rb | 71 - .../v1/reservation_service/client.rb | 3514 ----------------- .../v1/reservation_service/credentials.rb | 54 - .../v1/reservation_service/paths.rb | 147 - .../v1/reservation_service/rest.rb | 68 - .../v1/reservation_service/rest/client.rb | 3266 --------------- .../reservation_service/rest/service_stub.rb | 1889 --------- .../reservation/v1/reservation_services_pb.rb | 297 -- .../cloud/bigquery/reservation/v1/rest.rb | 39 - .../cloud/bigquery/reservation/v1/version.rb | 30 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 --- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 -- .../bigquery/reservation/v1/reservation.rb | 1190 ------ .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 -- .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../reservation_service/create_assignment.rb | 47 - .../create_capacity_commitment.rb | 47 - .../reservation_service/create_reservation.rb | 47 - .../create_reservation_group.rb | 47 - .../reservation_service/delete_assignment.rb | 47 - .../delete_capacity_commitment.rb | 47 - .../reservation_service/delete_reservation.rb | 47 - .../delete_reservation_group.rb | 47 - .../failover_reservation.rb | 47 - .../reservation_service/get_bi_reservation.rb | 47 - .../get_capacity_commitment.rb | 47 - .../reservation_service/get_iam_policy.rb | 47 - .../reservation_service/get_reservation.rb | 47 - .../get_reservation_group.rb | 47 - .../reservation_service/list_assignments.rb | 51 - .../list_capacity_commitments.rb | 51 - .../list_reservation_groups.rb | 51 - .../reservation_service/list_reservations.rb | 51 - .../merge_capacity_commitments.rb | 47 - .../reservation_service/move_assignment.rb | 47 - .../search_all_assignments.rb | 51 - .../reservation_service/search_assignments.rb | 51 - .../reservation_service/set_iam_policy.rb | 47 - .../split_capacity_commitment.rb | 47 - .../test_iam_permissions.rb | 47 - .../reservation_service/update_assignment.rb | 47 - .../update_bi_reservation.rb | 47 - .../update_capacity_commitment.rb | 47 - .../reservation_service/update_reservation.rb | 47 - ..._google.cloud.bigquery.reservation.v1.json | 1175 ------ .../v1/reservation_service_paths_test.rb | 115 - .../v1/reservation_service_rest_test.rb | 1703 -------- .../v1/reservation_service_test.rb | 1892 --------- .../test/helper.rb | 25 - 79 files changed, 6 insertions(+), 20219 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/google-cloud-bigquery-reservation-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google-cloud-bigquery-reservation-v1.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/cloud/bigquery/reservation/v1/reservation.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_assignment.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_capacity_commitment.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation_group.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_assignment.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_capacity_commitment.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation_group.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/failover_reservation.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_bi_reservation.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_capacity_commitment.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation_group.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_assignments.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_capacity_commitments.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservation_groups.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservations.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/merge_capacity_commitments.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/move_assignment.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_all_assignments.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_assignments.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/split_capacity_commitment.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_assignment.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_bi_reservation.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_capacity_commitment.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_reservation.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/snippet_metadata_google.cloud.bigquery.reservation.v1.json delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-bigquery-reservation-v1/test/helper.rb diff --git a/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_pb.rb b/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_pb.rb index 559b90607dd5..af0ae70246b9 100644 --- a/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_pb.rb +++ b/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_pb.rb @@ -16,7 +16,7 @@ require 'google/rpc/status_pb' -descriptor_data = "\n6google/cloud/bigquery/reservation/v1/reservation.proto\x12$google.cloud.bigquery.reservation.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xfc\x0c\n\x0bReservation\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1a\n\rslot_capacity\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1e\n\x11ignore_idle_slots\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12S\n\tautoscale\x18\x07 \x01(\x0b\x32;.google.cloud.bigquery.reservation.v1.Reservation.AutoscaleB\x03\xe0\x41\x01\x12\x18\n\x0b\x63oncurrency\x18\x10 \x01(\x03\x42\x03\xe0\x41\x01\x12\x36\n\rcreation_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\"\n\x16multi_region_auxiliary\x18\x0e \x01(\x08\x42\x02\x18\x01\x12\x43\n\x07\x65\x64ition\x18\x11 \x01(\x0e\x32-.google.cloud.bigquery.reservation.v1.EditionB\x03\xe0\x41\x01\x12\x43\n\x10primary_location\x18\x12 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!locations.googleapis.com/Location\x12\x45\n\x12secondary_location\x18\x13 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!locations.googleapis.com/Location\x12L\n\x19original_primary_location\x18\x14 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!locations.googleapis.com/Location\x12\x1b\n\tmax_slots\x18\x15 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12X\n\x0cscaling_mode\x18\x16 \x01(\x0e\x32=.google.cloud.bigquery.reservation.v1.Reservation.ScalingModeB\x03\xe0\x41\x01\x12R\n\x06labels\x18\x17 \x03(\x0b\x32=.google.cloud.bigquery.reservation.v1.Reservation.LabelsEntryB\x03\xe0\x41\x01\x12\x1e\n\x11reservation_group\x18\x19 \x01(\tB\x03\xe0\x41\x01\x12\x64\n\x12replication_status\x18\x18 \x01(\x0b\x32\x43.google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatusB\x03\xe0\x41\x03\x12V\n\x11scheduling_policy\x18\x1b \x01(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.SchedulingPolicyB\x03\xe0\x41\x01\x1a?\n\tAutoscale\x12\x1a\n\rcurrent_slots\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x16\n\tmax_slots\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x1a\xf8\x01\n\x11ReplicationStatus\x12&\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x38\n\x0flast_error_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12>\n\x15last_replication_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x18soft_failover_start_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"c\n\x0bScalingMode\x12\x1c\n\x18SCALING_MODE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x41UTOSCALE_ONLY\x10\x01\x12\x13\n\x0fIDLE_SLOTS_ONLY\x10\x02\x12\r\n\tALL_SLOTS\x10\x03:w\xea\x41t\n.bigqueryreservation.googleapis.com/Reservation\x12\x42projects/{project}/locations/{location}/reservations/{reservation}B\x0c\n\n_max_slots\"l\n\x10SchedulingPolicy\x12\x1d\n\x0b\x63oncurrency\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1b\n\tmax_slots\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x0e\n\x0c_concurrencyB\x0c\n\n_max_slots\"\xd5\x01\n\x10ReservationGroup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08:\xad\x01\xea\x41\xa9\x01\n3bigqueryreservation.googleapis.com/ReservationGroup\x12Mprojects/{project}/locations/{location}/reservationGroups/{reservation_group}*\x11reservationGroups2\x10reservationGroup\"\xaa\x08\n\x12\x43\x61pacityCommitment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nslot_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12Z\n\x04plan\x18\x03 \x01(\x0e\x32G.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlanB\x03\xe0\x41\x01\x12R\n\x05state\x18\x04 \x01(\x0e\x32>.google.cloud.bigquery.reservation.v1.CapacityCommitment.StateB\x03\xe0\x41\x03\x12>\n\x15\x63ommitment_start_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x13\x63ommitment_end_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12/\n\x0e\x66\x61ilure_status\x18\x07 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x62\n\x0crenewal_plan\x18\x08 \x01(\x0e\x32G.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlanB\x03\xe0\x41\x01\x12\"\n\x16multi_region_auxiliary\x18\n \x01(\x08\x42\x02\x18\x01\x12\x43\n\x07\x65\x64ition\x18\x0c \x01(\x0e\x32-.google.cloud.bigquery.reservation.v1.EditionB\x03\xe0\x41\x01\x12\x19\n\x0cis_flat_rate\x18\x0e \x01(\x08\x42\x03\xe0\x41\x03\"\xca\x01\n\x0e\x43ommitmentPlan\x12\x1f\n\x1b\x43OMMITMENT_PLAN_UNSPECIFIED\x10\x00\x12\x08\n\x04\x46LEX\x10\x03\x12\x16\n\x0e\x46LEX_FLAT_RATE\x10\x07\x1a\x02\x08\x01\x12\r\n\x05TRIAL\x10\x05\x1a\x02\x08\x01\x12\x0b\n\x07MONTHLY\x10\x02\x12\x19\n\x11MONTHLY_FLAT_RATE\x10\x08\x1a\x02\x08\x01\x12\n\n\x06\x41NNUAL\x10\x04\x12\x18\n\x10\x41NNUAL_FLAT_RATE\x10\t\x1a\x02\x08\x01\x12\x0e\n\nTHREE_YEAR\x10\n\x12\x08\n\x04NONE\x10\x06\"C\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03:\x8e\x01\xea\x41\x8a\x01\n5bigqueryreservation.googleapis.com/CapacityCommitment\x12Qprojects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}\"\xc2\x01\n\x18\x43reateReservationRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.bigqueryreservation.googleapis.com/Reservation\x12\x16\n\x0ereservation_id\x18\x02 \x01(\t\x12\x46\n\x0breservation\x18\x03 \x01(\x0b\x32\x31.google.cloud.bigquery.reservation.v1.Reservation\"\x88\x01\n\x17ListReservationsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.bigqueryreservation.googleapis.com/Reservation\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"|\n\x18ListReservationsResponse\x12G\n\x0creservations\x18\x01 \x03(\x0b\x32\x31.google.cloud.bigquery.reservation.v1.Reservation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x15GetReservationRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.bigqueryreservation.googleapis.com/Reservation\"`\n\x18\x44\x65leteReservationRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.bigqueryreservation.googleapis.com/Reservation\"\x93\x01\n\x18UpdateReservationRequest\x12\x46\n\x0breservation\x18\x01 \x01(\x0b\x32\x31.google.cloud.bigquery.reservation.v1.Reservation\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xb2\x01\n\x1a\x46\x61iloverReservationRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.bigqueryreservation.googleapis.com/Reservation\x12N\n\rfailover_mode\x18\x02 \x01(\x0e\x32\x32.google.cloud.bigquery.reservation.v1.FailoverModeB\x03\xe0\x41\x01\"\xe7\x01\n\x1d\x43reateReservationGroupRequest\x12K\n\x06parent\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\x12\x33\x62igqueryreservation.googleapis.com/ReservationGroup\x12!\n\x14reservation_group_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12V\n\x11reservation_group\x18\x03 \x01(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.ReservationGroupB\x03\xe0\x41\x02\"g\n\x1aGetReservationGroupRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3bigqueryreservation.googleapis.com/ReservationGroup\"\x92\x01\n\x1cListReservationGroupsRequest\x12K\n\x06parent\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\x12\x33\x62igqueryreservation.googleapis.com/ReservationGroup\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x8c\x01\n\x1dListReservationGroupsResponse\x12R\n\x12reservation_groups\x18\x01 \x03(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.ReservationGroup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"j\n\x1d\x44\x65leteReservationGroupRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3bigqueryreservation.googleapis.com/ReservationGroup\"\x95\x02\n\x1f\x43reateCapacityCommitmentRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35\x62igqueryreservation.googleapis.com/CapacityCommitment\x12U\n\x13\x63\x61pacity_commitment\x18\x02 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12,\n$enforce_single_admin_project_per_org\x18\x04 \x01(\x08\x12\x1e\n\x16\x63\x61pacity_commitment_id\x18\x05 \x01(\t\"\x96\x01\n\x1eListCapacityCommitmentsRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35\x62igqueryreservation.googleapis.com/CapacityCommitment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x92\x01\n\x1fListCapacityCommitmentsResponse\x12V\n\x14\x63\x61pacity_commitments\x18\x01 \x03(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"k\n\x1cGetCapacityCommitmentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5bigqueryreservation.googleapis.com/CapacityCommitment\"}\n\x1f\x44\x65leteCapacityCommitmentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5bigqueryreservation.googleapis.com/CapacityCommitment\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\"\xa9\x01\n\x1fUpdateCapacityCommitmentRequest\x12U\n\x13\x63\x61pacity_commitment\x18\x01 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x81\x01\n\x1eSplitCapacityCommitmentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5bigqueryreservation.googleapis.com/CapacityCommitment\x12\x12\n\nslot_count\x18\x02 \x01(\x03\"\xb4\x01\n\x1fSplitCapacityCommitmentResponse\x12G\n\x05\x66irst\x18\x01 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12H\n\x06second\x18\x02 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\"\xb3\x01\n\x1fMergeCapacityCommitmentsRequest\x12J\n\x06parent\x18\x01 \x01(\tB:\xfa\x41\x37\x12\x35\x62igqueryreservation.googleapis.com/CapacityCommitment\x12\x1f\n\x17\x63\x61pacity_commitment_ids\x18\x02 \x03(\t\x12#\n\x16\x63\x61pacity_commitment_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x97\x06\n\nAssignment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08\x61ssignee\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12O\n\x08job_type\x18\x03 \x01(\x0e\x32\x38.google.cloud.bigquery.reservation.v1.Assignment.JobTypeB\x03\xe0\x41\x01\x12J\n\x05state\x18\x06 \x01(\x0e\x32\x36.google.cloud.bigquery.reservation.v1.Assignment.StateB\x03\xe0\x41\x03\x12&\n\x19\x65nable_gemini_in_bigquery\x18\n \x01(\x08\x42\x03\xe0\x41\x01\x12V\n\x11scheduling_policy\x18\x0b \x01(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.SchedulingPolicyB\x03\xe0\x41\x01\"\xdc\x01\n\x07JobType\x12\x18\n\x14JOB_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08PIPELINE\x10\x01\x12\t\n\x05QUERY\x10\x02\x12\x0f\n\x0bML_EXTERNAL\x10\x03\x12\x0e\n\nBACKGROUND\x10\x04\x12\x0e\n\nCONTINUOUS\x10\x06\x12\"\n\x1e\x42\x41\x43KGROUND_CHANGE_DATA_CAPTURE\x10\x07\x12$\n BACKGROUND_COLUMN_METADATA_INDEX\x10\x08\x12#\n\x1f\x42\x41\x43KGROUND_SEARCH_INDEX_REFRESH\x10\t\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02:\xa9\x01\xea\x41\xa5\x01\n-bigqueryreservation.googleapis.com/Assignment\x12[projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}*\x0b\x61ssignments2\nassignment\"\xbd\x01\n\x17\x43reateAssignmentRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-bigqueryreservation.googleapis.com/Assignment\x12\x44\n\nassignment\x18\x02 \x01(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x15\n\rassignment_id\x18\x04 \x01(\t\"\x86\x01\n\x16ListAssignmentsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-bigqueryreservation.googleapis.com/Assignment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"y\n\x17ListAssignmentsResponse\x12\x45\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"^\n\x17\x44\x65leteAssignmentRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-bigqueryreservation.googleapis.com/Assignment\"\x8b\x01\n\x18SearchAssignmentsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\r\n\x05query\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"\x8e\x01\n\x1bSearchAllAssignmentsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\r\n\x05query\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"{\n\x19SearchAssignmentsResponse\x12\x45\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"~\n\x1cSearchAllAssignmentsResponse\x12\x45\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xbf\x01\n\x15MoveAssignmentRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-bigqueryreservation.googleapis.com/Assignment\x12J\n\x0e\x64\x65stination_id\x18\x03 \x01(\tB2\xfa\x41/\x12-bigqueryreservation.googleapis.com/Assignment\x12\x15\n\rassignment_id\x18\x05 \x01(\t\"\x90\x01\n\x17UpdateAssignmentRequest\x12\x44\n\nassignment\x18\x01 \x01(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"Y\n\x0eTableReference\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\ndataset_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08table_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xae\x02\n\rBiReservation\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04size\x18\x04 \x01(\x03\x42\x03\xe0\x41\x01\x12S\n\x10preferred_tables\x18\x05 \x03(\x0b\x32\x34.google.cloud.bigquery.reservation.v1.TableReferenceB\x03\xe0\x41\x01:l\xea\x41i\n0bigqueryreservation.googleapis.com/BiReservation\x12\x35projects/{project}/locations/{location}/biReservation\"a\n\x17GetBiReservationRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0bigqueryreservation.googleapis.com/BiReservation\"\x9a\x01\n\x1aUpdateBiReservationRequest\x12K\n\x0e\x62i_reservation\x18\x01 \x01(\x0b\x32\x33.google.cloud.bigquery.reservation.v1.BiReservation\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask*U\n\x07\x45\x64ition\x12\x17\n\x13\x45\x44ITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x0e\n\nENTERPRISE\x10\x02\x12\x13\n\x0f\x45NTERPRISE_PLUS\x10\x03*A\n\x0c\x46\x61iloverMode\x12\x1d\n\x19\x46\x41ILOVER_MODE_UNSPECIFIED\x10\x00\x12\x08\n\x04SOFT\x10\x01\x12\x08\n\x04HARD\x10\x02\x32\xa3\x36\n\x12ReservationService\x12\xf1\x01\n\x11\x43reateReservation\x12>.google.cloud.bigquery.reservation.v1.CreateReservationRequest\x1a\x31.google.cloud.bigquery.reservation.v1.Reservation\"i\xda\x41!parent,reservation,reservation_id\x82\xd3\xe4\x93\x02?\"0/v1/{parent=projects/*/locations/*}/reservations:\x0breservation\x12\xd4\x01\n\x10ListReservations\x12=.google.cloud.bigquery.reservation.v1.ListReservationsRequest\x1a>.google.cloud.bigquery.reservation.v1.ListReservationsResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{parent=projects/*/locations/*}/reservations\x12\xc1\x01\n\x0eGetReservation\x12;.google.cloud.bigquery.reservation.v1.GetReservationRequest\x1a\x31.google.cloud.bigquery.reservation.v1.Reservation\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{name=projects/*/locations/*/reservations/*}\x12\xac\x01\n\x11\x44\x65leteReservation\x12>.google.cloud.bigquery.reservation.v1.DeleteReservationRequest\x1a\x16.google.protobuf.Empty\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32*0/v1/{name=projects/*/locations/*/reservations/*}\x12\xf3\x01\n\x11UpdateReservation\x12>.google.cloud.bigquery.reservation.v1.UpdateReservationRequest\x1a\x31.google.cloud.bigquery.reservation.v1.Reservation\"k\xda\x41\x17reservation,update_mask\x82\xd3\xe4\x93\x02K2/v1/{parent=projects/*/locations/*/reservations/*}/assignments:\nassignment\x12\xdf\x01\n\x0fListAssignments\x12<.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest\x1a=.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1/{parent=projects/*/locations/*/reservations/*}/assignments\x12\xb8\x01\n\x10\x44\x65leteAssignment\x12=.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest\x1a\x16.google.protobuf.Empty\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@*>/v1/{name=projects/*/locations/*/reservations/*/assignments/*}\x12\xe5\x01\n\x11SearchAssignments\x12>.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest\x1a?.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse\"O\x88\x02\x01\xda\x41\x0cparent,query\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*}:searchAssignments\x12\xee\x01\n\x14SearchAllAssignments\x12\x41.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest\x1a\x42.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse\"O\xda\x41\x0cparent,query\x82\xd3\xe4\x93\x02:\x12\x38/v1/{parent=projects/*/locations/*}:searchAllAssignments\x12\xe5\x01\n\x0eMoveAssignment\x12;.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest\x1a\x30.google.cloud.bigquery.reservation.v1.Assignment\"d\xda\x41\x13name,destination_id\x82\xd3\xe4\x93\x02H\"C/v1/{name=projects/*/locations/*/reservations/*/assignments/*}:move:\x01*\x12\xfb\x01\n\x10UpdateAssignment\x12=.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest\x1a\x30.google.cloud.bigquery.reservation.v1.Assignment\"v\xda\x41\x16\x61ssignment,update_mask\x82\xd3\xe4\x93\x02W2I/v1/{assignment.name=projects/*/locations/*/reservations/*/assignments/*}:\nassignment\x12\xc6\x01\n\x10GetBiReservation\x12=.google.cloud.bigquery.reservation.v1.GetBiReservationRequest\x1a\x33.google.cloud.bigquery.reservation.v1.BiReservation\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v1/{name=projects/*/locations/*/biReservation}\x12\x81\x02\n\x13UpdateBiReservation\x12@.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest\x1a\x33.google.cloud.bigquery.reservation.v1.BiReservation\"s\xda\x41\x1a\x62i_reservation,update_mask\x82\xd3\xe4\x93\x02P2>/v1/{bi_reservation.name=projects/*/locations/*/biReservation}:\x0e\x62i_reservation\x12\xf4\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xa8\x01\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x96\x01\x12\x41/v1/{resource=projects/*/locations/*/reservations/*}:getIamPolicyZQ\x12O/v1/{resource=projects/*/locations/*/reservations/*/assignments/*}:getIamPolicy\x12\x81\x02\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xb5\x01\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x9c\x01\"A/v1/{resource=projects/*/locations/*/reservations/*}:setIamPolicy:\x01*ZT\"O/v1/{resource=projects/*/locations/*/reservations/*/assignments/*}:setIamPolicy:\x01*\x12\x9b\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\xaf\x01\x82\xd3\xe4\x93\x02\xa8\x01\"G/v1/{resource=projects/*/locations/*/reservations/*}:testIamPermissions:\x01*ZZ\"U/v1/{resource=projects/*/locations/*/reservations/*/assignments/*}:testIamPermissions:\x01*\x12\xe7\x01\n\x16\x43reateReservationGroup\x12\x43.google.cloud.bigquery.reservation.v1.CreateReservationGroupRequest\x1a\x36.google.cloud.bigquery.reservation.v1.ReservationGroup\"P\x82\xd3\xe4\x93\x02J\"5/v1/{parent=projects/*/locations/*}/reservationGroups:\x11reservation_group\x12\xd5\x01\n\x13GetReservationGroup\x12@.google.cloud.bigquery.reservation.v1.GetReservationGroupRequest\x1a\x36.google.cloud.bigquery.reservation.v1.ReservationGroup\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/reservationGroups/*}\x12\xbb\x01\n\x16\x44\x65leteReservationGroup\x12\x43.google.cloud.bigquery.reservation.v1.DeleteReservationGroupRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v1/{name=projects/*/locations/*/reservationGroups/*}\x12\xe8\x01\n\x15ListReservationGroups\x12\x42.google.cloud.bigquery.reservation.v1.ListReservationGroupsRequest\x1a\x43.google.cloud.bigquery.reservation.v1.ListReservationGroupsResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*}/reservationGroups\x1a\x7f\xca\x41\"bigqueryreservation.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platformB\xd8\x01\n(com.google.cloud.bigquery.reservation.v1B\x10ReservationProtoP\x01ZJcloud.google.com/go/bigquery/reservation/apiv1/reservationpb;reservationpb\xaa\x02$Google.Cloud.BigQuery.Reservation.V1\xca\x02$Google\\Cloud\\BigQuery\\Reservation\\V1b\x06proto3" +descriptor_data = "\n6google/cloud/bigquery/reservation/v1/reservation.proto\x12$google.cloud.bigquery.reservation.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xfc\x0c\n\x0bReservation\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1a\n\rslot_capacity\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1e\n\x11ignore_idle_slots\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12S\n\tautoscale\x18\x07 \x01(\x0b\x32;.google.cloud.bigquery.reservation.v1.Reservation.AutoscaleB\x03\xe0\x41\x01\x12\x18\n\x0b\x63oncurrency\x18\x10 \x01(\x03\x42\x03\xe0\x41\x01\x12\x36\n\rcreation_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\"\n\x16multi_region_auxiliary\x18\x0e \x01(\x08\x42\x02\x18\x01\x12\x43\n\x07\x65\x64ition\x18\x11 \x01(\x0e\x32-.google.cloud.bigquery.reservation.v1.EditionB\x03\xe0\x41\x01\x12\x43\n\x10primary_location\x18\x12 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!locations.googleapis.com/Location\x12\x45\n\x12secondary_location\x18\x13 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!locations.googleapis.com/Location\x12L\n\x19original_primary_location\x18\x14 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!locations.googleapis.com/Location\x12\x1b\n\tmax_slots\x18\x15 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12X\n\x0cscaling_mode\x18\x16 \x01(\x0e\x32=.google.cloud.bigquery.reservation.v1.Reservation.ScalingModeB\x03\xe0\x41\x01\x12R\n\x06labels\x18\x17 \x03(\x0b\x32=.google.cloud.bigquery.reservation.v1.Reservation.LabelsEntryB\x03\xe0\x41\x01\x12\x1e\n\x11reservation_group\x18\x19 \x01(\tB\x03\xe0\x41\x01\x12\x64\n\x12replication_status\x18\x18 \x01(\x0b\x32\x43.google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatusB\x03\xe0\x41\x03\x12V\n\x11scheduling_policy\x18\x1b \x01(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.SchedulingPolicyB\x03\xe0\x41\x01\x1a?\n\tAutoscale\x12\x1a\n\rcurrent_slots\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x16\n\tmax_slots\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x1a\xf8\x01\n\x11ReplicationStatus\x12&\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x38\n\x0flast_error_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12>\n\x15last_replication_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x18soft_failover_start_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"c\n\x0bScalingMode\x12\x1c\n\x18SCALING_MODE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x41UTOSCALE_ONLY\x10\x01\x12\x13\n\x0fIDLE_SLOTS_ONLY\x10\x02\x12\r\n\tALL_SLOTS\x10\x03:w\xea\x41t\n.bigqueryreservation.googleapis.com/Reservation\x12\x42projects/{project}/locations/{location}/reservations/{reservation}B\x0c\n\n_max_slots\"l\n\x10SchedulingPolicy\x12\x1d\n\x0b\x63oncurrency\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1b\n\tmax_slots\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x0e\n\x0c_concurrencyB\x0c\n\n_max_slots\"\xd5\x01\n\x10ReservationGroup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08:\xad\x01\xea\x41\xa9\x01\n3bigqueryreservation.googleapis.com/ReservationGroup\x12Mprojects/{project}/locations/{location}/reservationGroups/{reservation_group}*\x11reservationGroups2\x10reservationGroup\"\xaa\x08\n\x12\x43\x61pacityCommitment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nslot_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12Z\n\x04plan\x18\x03 \x01(\x0e\x32G.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlanB\x03\xe0\x41\x01\x12R\n\x05state\x18\x04 \x01(\x0e\x32>.google.cloud.bigquery.reservation.v1.CapacityCommitment.StateB\x03\xe0\x41\x03\x12>\n\x15\x63ommitment_start_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x13\x63ommitment_end_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12/\n\x0e\x66\x61ilure_status\x18\x07 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x62\n\x0crenewal_plan\x18\x08 \x01(\x0e\x32G.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlanB\x03\xe0\x41\x01\x12\"\n\x16multi_region_auxiliary\x18\n \x01(\x08\x42\x02\x18\x01\x12\x43\n\x07\x65\x64ition\x18\x0c \x01(\x0e\x32-.google.cloud.bigquery.reservation.v1.EditionB\x03\xe0\x41\x01\x12\x19\n\x0cis_flat_rate\x18\x0e \x01(\x08\x42\x03\xe0\x41\x03\"\xca\x01\n\x0e\x43ommitmentPlan\x12\x1f\n\x1b\x43OMMITMENT_PLAN_UNSPECIFIED\x10\x00\x12\x08\n\x04\x46LEX\x10\x03\x12\x16\n\x0e\x46LEX_FLAT_RATE\x10\x07\x1a\x02\x08\x01\x12\r\n\x05TRIAL\x10\x05\x1a\x02\x08\x01\x12\x0b\n\x07MONTHLY\x10\x02\x12\x19\n\x11MONTHLY_FLAT_RATE\x10\x08\x1a\x02\x08\x01\x12\n\n\x06\x41NNUAL\x10\x04\x12\x18\n\x10\x41NNUAL_FLAT_RATE\x10\t\x1a\x02\x08\x01\x12\x0e\n\nTHREE_YEAR\x10\n\x12\x08\n\x04NONE\x10\x06\"C\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03:\x8e\x01\xea\x41\x8a\x01\n5bigqueryreservation.googleapis.com/CapacityCommitment\x12Qprojects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}\"\xc2\x01\n\x18\x43reateReservationRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.bigqueryreservation.googleapis.com/Reservation\x12\x16\n\x0ereservation_id\x18\x02 \x01(\t\x12\x46\n\x0breservation\x18\x03 \x01(\x0b\x32\x31.google.cloud.bigquery.reservation.v1.Reservation\"\x88\x01\n\x17ListReservationsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.bigqueryreservation.googleapis.com/Reservation\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"|\n\x18ListReservationsResponse\x12G\n\x0creservations\x18\x01 \x03(\x0b\x32\x31.google.cloud.bigquery.reservation.v1.Reservation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x15GetReservationRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.bigqueryreservation.googleapis.com/Reservation\"`\n\x18\x44\x65leteReservationRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.bigqueryreservation.googleapis.com/Reservation\"\x93\x01\n\x18UpdateReservationRequest\x12\x46\n\x0breservation\x18\x01 \x01(\x0b\x32\x31.google.cloud.bigquery.reservation.v1.Reservation\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xb2\x01\n\x1a\x46\x61iloverReservationRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.bigqueryreservation.googleapis.com/Reservation\x12N\n\rfailover_mode\x18\x02 \x01(\x0e\x32\x32.google.cloud.bigquery.reservation.v1.FailoverModeB\x03\xe0\x41\x01\"\xe7\x01\n\x1d\x43reateReservationGroupRequest\x12K\n\x06parent\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\x12\x33\x62igqueryreservation.googleapis.com/ReservationGroup\x12!\n\x14reservation_group_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12V\n\x11reservation_group\x18\x03 \x01(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.ReservationGroupB\x03\xe0\x41\x02\"g\n\x1aGetReservationGroupRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3bigqueryreservation.googleapis.com/ReservationGroup\"\x92\x01\n\x1cListReservationGroupsRequest\x12K\n\x06parent\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\x12\x33\x62igqueryreservation.googleapis.com/ReservationGroup\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x8c\x01\n\x1dListReservationGroupsResponse\x12R\n\x12reservation_groups\x18\x01 \x03(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.ReservationGroup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"j\n\x1d\x44\x65leteReservationGroupRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3bigqueryreservation.googleapis.com/ReservationGroup\"\x95\x02\n\x1f\x43reateCapacityCommitmentRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35\x62igqueryreservation.googleapis.com/CapacityCommitment\x12U\n\x13\x63\x61pacity_commitment\x18\x02 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12,\n$enforce_single_admin_project_per_org\x18\x04 \x01(\x08\x12\x1e\n\x16\x63\x61pacity_commitment_id\x18\x05 \x01(\t\"\x96\x01\n\x1eListCapacityCommitmentsRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35\x62igqueryreservation.googleapis.com/CapacityCommitment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x92\x01\n\x1fListCapacityCommitmentsResponse\x12V\n\x14\x63\x61pacity_commitments\x18\x01 \x03(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"k\n\x1cGetCapacityCommitmentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5bigqueryreservation.googleapis.com/CapacityCommitment\"}\n\x1f\x44\x65leteCapacityCommitmentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5bigqueryreservation.googleapis.com/CapacityCommitment\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\"\xa9\x01\n\x1fUpdateCapacityCommitmentRequest\x12U\n\x13\x63\x61pacity_commitment\x18\x01 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x81\x01\n\x1eSplitCapacityCommitmentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5bigqueryreservation.googleapis.com/CapacityCommitment\x12\x12\n\nslot_count\x18\x02 \x01(\x03\"\xb4\x01\n\x1fSplitCapacityCommitmentResponse\x12G\n\x05\x66irst\x18\x01 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12H\n\x06second\x18\x02 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\"\xb3\x01\n\x1fMergeCapacityCommitmentsRequest\x12J\n\x06parent\x18\x01 \x01(\tB:\xfa\x41\x37\x12\x35\x62igqueryreservation.googleapis.com/CapacityCommitment\x12\x1f\n\x17\x63\x61pacity_commitment_ids\x18\x02 \x03(\t\x12#\n\x16\x63\x61pacity_commitment_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x99\x06\n\nAssignment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08\x61ssignee\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12O\n\x08job_type\x18\x03 \x01(\x0e\x32\x38.google.cloud.bigquery.reservation.v1.Assignment.JobTypeB\x03\xe0\x41\x01\x12J\n\x05state\x18\x06 \x01(\x0e\x32\x36.google.cloud.bigquery.reservation.v1.Assignment.StateB\x03\xe0\x41\x03\x12(\n\x19\x65nable_gemini_in_bigquery\x18\n \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12V\n\x11scheduling_policy\x18\x0b \x01(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.SchedulingPolicyB\x03\xe0\x41\x01\"\xdc\x01\n\x07JobType\x12\x18\n\x14JOB_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08PIPELINE\x10\x01\x12\t\n\x05QUERY\x10\x02\x12\x0f\n\x0bML_EXTERNAL\x10\x03\x12\x0e\n\nBACKGROUND\x10\x04\x12\x0e\n\nCONTINUOUS\x10\x06\x12\"\n\x1e\x42\x41\x43KGROUND_CHANGE_DATA_CAPTURE\x10\x07\x12$\n BACKGROUND_COLUMN_METADATA_INDEX\x10\x08\x12#\n\x1f\x42\x41\x43KGROUND_SEARCH_INDEX_REFRESH\x10\t\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02:\xa9\x01\xea\x41\xa5\x01\n-bigqueryreservation.googleapis.com/Assignment\x12[projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}*\x0b\x61ssignments2\nassignment\"\xbd\x01\n\x17\x43reateAssignmentRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-bigqueryreservation.googleapis.com/Assignment\x12\x44\n\nassignment\x18\x02 \x01(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x15\n\rassignment_id\x18\x04 \x01(\t\"\x86\x01\n\x16ListAssignmentsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-bigqueryreservation.googleapis.com/Assignment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"y\n\x17ListAssignmentsResponse\x12\x45\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"^\n\x17\x44\x65leteAssignmentRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-bigqueryreservation.googleapis.com/Assignment\"\x8b\x01\n\x18SearchAssignmentsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\r\n\x05query\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"\x8e\x01\n\x1bSearchAllAssignmentsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\r\n\x05query\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"{\n\x19SearchAssignmentsResponse\x12\x45\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"~\n\x1cSearchAllAssignmentsResponse\x12\x45\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xbf\x01\n\x15MoveAssignmentRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-bigqueryreservation.googleapis.com/Assignment\x12J\n\x0e\x64\x65stination_id\x18\x03 \x01(\tB2\xfa\x41/\x12-bigqueryreservation.googleapis.com/Assignment\x12\x15\n\rassignment_id\x18\x05 \x01(\t\"\x90\x01\n\x17UpdateAssignmentRequest\x12\x44\n\nassignment\x18\x01 \x01(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"Y\n\x0eTableReference\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\ndataset_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08table_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xae\x02\n\rBiReservation\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04size\x18\x04 \x01(\x03\x42\x03\xe0\x41\x01\x12S\n\x10preferred_tables\x18\x05 \x03(\x0b\x32\x34.google.cloud.bigquery.reservation.v1.TableReferenceB\x03\xe0\x41\x01:l\xea\x41i\n0bigqueryreservation.googleapis.com/BiReservation\x12\x35projects/{project}/locations/{location}/biReservation\"a\n\x17GetBiReservationRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0bigqueryreservation.googleapis.com/BiReservation\"\x9a\x01\n\x1aUpdateBiReservationRequest\x12K\n\x0e\x62i_reservation\x18\x01 \x01(\x0b\x32\x33.google.cloud.bigquery.reservation.v1.BiReservation\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask*U\n\x07\x45\x64ition\x12\x17\n\x13\x45\x44ITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x0e\n\nENTERPRISE\x10\x02\x12\x13\n\x0f\x45NTERPRISE_PLUS\x10\x03*A\n\x0c\x46\x61iloverMode\x12\x1d\n\x19\x46\x41ILOVER_MODE_UNSPECIFIED\x10\x00\x12\x08\n\x04SOFT\x10\x01\x12\x08\n\x04HARD\x10\x02\x32\xa3\x36\n\x12ReservationService\x12\xf1\x01\n\x11\x43reateReservation\x12>.google.cloud.bigquery.reservation.v1.CreateReservationRequest\x1a\x31.google.cloud.bigquery.reservation.v1.Reservation\"i\xda\x41!parent,reservation,reservation_id\x82\xd3\xe4\x93\x02?\"0/v1/{parent=projects/*/locations/*}/reservations:\x0breservation\x12\xd4\x01\n\x10ListReservations\x12=.google.cloud.bigquery.reservation.v1.ListReservationsRequest\x1a>.google.cloud.bigquery.reservation.v1.ListReservationsResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{parent=projects/*/locations/*}/reservations\x12\xc1\x01\n\x0eGetReservation\x12;.google.cloud.bigquery.reservation.v1.GetReservationRequest\x1a\x31.google.cloud.bigquery.reservation.v1.Reservation\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{name=projects/*/locations/*/reservations/*}\x12\xac\x01\n\x11\x44\x65leteReservation\x12>.google.cloud.bigquery.reservation.v1.DeleteReservationRequest\x1a\x16.google.protobuf.Empty\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32*0/v1/{name=projects/*/locations/*/reservations/*}\x12\xf3\x01\n\x11UpdateReservation\x12>.google.cloud.bigquery.reservation.v1.UpdateReservationRequest\x1a\x31.google.cloud.bigquery.reservation.v1.Reservation\"k\xda\x41\x17reservation,update_mask\x82\xd3\xe4\x93\x02K2/v1/{parent=projects/*/locations/*/reservations/*}/assignments:\nassignment\x12\xdf\x01\n\x0fListAssignments\x12<.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest\x1a=.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1/{parent=projects/*/locations/*/reservations/*}/assignments\x12\xb8\x01\n\x10\x44\x65leteAssignment\x12=.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest\x1a\x16.google.protobuf.Empty\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@*>/v1/{name=projects/*/locations/*/reservations/*/assignments/*}\x12\xe5\x01\n\x11SearchAssignments\x12>.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest\x1a?.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse\"O\x88\x02\x01\xda\x41\x0cparent,query\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*}:searchAssignments\x12\xee\x01\n\x14SearchAllAssignments\x12\x41.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest\x1a\x42.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse\"O\xda\x41\x0cparent,query\x82\xd3\xe4\x93\x02:\x12\x38/v1/{parent=projects/*/locations/*}:searchAllAssignments\x12\xe5\x01\n\x0eMoveAssignment\x12;.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest\x1a\x30.google.cloud.bigquery.reservation.v1.Assignment\"d\xda\x41\x13name,destination_id\x82\xd3\xe4\x93\x02H\"C/v1/{name=projects/*/locations/*/reservations/*/assignments/*}:move:\x01*\x12\xfb\x01\n\x10UpdateAssignment\x12=.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest\x1a\x30.google.cloud.bigquery.reservation.v1.Assignment\"v\xda\x41\x16\x61ssignment,update_mask\x82\xd3\xe4\x93\x02W2I/v1/{assignment.name=projects/*/locations/*/reservations/*/assignments/*}:\nassignment\x12\xc6\x01\n\x10GetBiReservation\x12=.google.cloud.bigquery.reservation.v1.GetBiReservationRequest\x1a\x33.google.cloud.bigquery.reservation.v1.BiReservation\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v1/{name=projects/*/locations/*/biReservation}\x12\x81\x02\n\x13UpdateBiReservation\x12@.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest\x1a\x33.google.cloud.bigquery.reservation.v1.BiReservation\"s\xda\x41\x1a\x62i_reservation,update_mask\x82\xd3\xe4\x93\x02P2>/v1/{bi_reservation.name=projects/*/locations/*/biReservation}:\x0e\x62i_reservation\x12\xf4\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xa8\x01\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x96\x01\x12\x41/v1/{resource=projects/*/locations/*/reservations/*}:getIamPolicyZQ\x12O/v1/{resource=projects/*/locations/*/reservations/*/assignments/*}:getIamPolicy\x12\x81\x02\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xb5\x01\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x9c\x01\"A/v1/{resource=projects/*/locations/*/reservations/*}:setIamPolicy:\x01*ZT\"O/v1/{resource=projects/*/locations/*/reservations/*/assignments/*}:setIamPolicy:\x01*\x12\x9b\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\xaf\x01\x82\xd3\xe4\x93\x02\xa8\x01\"G/v1/{resource=projects/*/locations/*/reservations/*}:testIamPermissions:\x01*ZZ\"U/v1/{resource=projects/*/locations/*/reservations/*/assignments/*}:testIamPermissions:\x01*\x12\xe7\x01\n\x16\x43reateReservationGroup\x12\x43.google.cloud.bigquery.reservation.v1.CreateReservationGroupRequest\x1a\x36.google.cloud.bigquery.reservation.v1.ReservationGroup\"P\x82\xd3\xe4\x93\x02J\"5/v1/{parent=projects/*/locations/*}/reservationGroups:\x11reservation_group\x12\xd5\x01\n\x13GetReservationGroup\x12@.google.cloud.bigquery.reservation.v1.GetReservationGroupRequest\x1a\x36.google.cloud.bigquery.reservation.v1.ReservationGroup\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/reservationGroups/*}\x12\xbb\x01\n\x16\x44\x65leteReservationGroup\x12\x43.google.cloud.bigquery.reservation.v1.DeleteReservationGroupRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v1/{name=projects/*/locations/*/reservationGroups/*}\x12\xe8\x01\n\x15ListReservationGroups\x12\x42.google.cloud.bigquery.reservation.v1.ListReservationGroupsRequest\x1a\x43.google.cloud.bigquery.reservation.v1.ListReservationGroupsResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*}/reservationGroups\x1a\x7f\xca\x41\"bigqueryreservation.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platformB\xd8\x01\n(com.google.cloud.bigquery.reservation.v1B\x10ReservationProtoP\x01ZJcloud.google.com/go/bigquery/reservation/apiv1/reservationpb;reservationpb\xaa\x02$Google.Cloud.BigQuery.Reservation.V1\xca\x02$Google\\Cloud\\BigQuery\\Reservation\\V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool diff --git a/google-cloud-bigquery-reservation-v1/proto_docs/google/cloud/bigquery/reservation/v1/reservation.rb b/google-cloud-bigquery-reservation-v1/proto_docs/google/cloud/bigquery/reservation/v1/reservation.rb index ec745b406002..49b28cbec03e 100644 --- a/google-cloud-bigquery-reservation-v1/proto_docs/google/cloud/bigquery/reservation/v1/reservation.rb +++ b/google-cloud-bigquery-reservation-v1/proto_docs/google/cloud/bigquery/reservation/v1/reservation.rb @@ -815,15 +815,13 @@ class MergeCapacityCommitmentsRequest # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment::State] # Output only. State of the assignment. # @!attribute [rw] enable_gemini_in_bigquery + # @deprecated This field is deprecated and may be removed in the next major version update. # @return [::Boolean] - # Optional. This field controls if "Gemini in BigQuery" + # Optional. Deprecated: "Gemini in BigQuery" is now available by + # default for all BigQuery editions and should not be explicitly set. + # Controls if "Gemini in BigQuery" # (https://cloud.google.com/gemini/docs/bigquery/overview) features should be - # enabled for this reservation assignment, which is not on by default. - # "Gemini in BigQuery" has a distinct compliance posture from BigQuery. If - # this field is set to true, the assignment job type is QUERY, and - # the parent reservation edition is ENTERPRISE_PLUS, then the assignment will - # give the grantee project/organization access to "Gemini in BigQuery" - # features. + # enabled for this reservation assignment. # @!attribute [rw] scheduling_policy # @return [::Google::Cloud::Bigquery::Reservation::V1::SchedulingPolicy] # Optional. The scheduling policy to use for jobs and queries of this diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/.gitignore b/owl-bot-staging/google-cloud-bigquery-reservation-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-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-bigquery-reservation-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-bigquery-reservation-v1/.repo-metadata.json deleted file mode 100644 index a2ae9c6f27bd..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "bigqueryreservation.googleapis.com", - "api_shortname": "bigqueryreservation", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-bigquery-reservation-v1/latest", - "distribution_name": "google-cloud-bigquery-reservation-v1", - "is_cloud": true, - "language": "ruby", - "name": "bigqueryreservation", - "name_pretty": "BigQuery Reservation V1 API", - "product_documentation": "https://cloud.google.com/bigquery/docs/reference/reservations", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "The BigQuery Reservation API provides the mechanisms by which enterprise users can provision and manage dedicated resources such as slots and BigQuery BI Engine memory allocations. Note that google-cloud-bigquery-reservation-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-bigquery-reservation instead. See the readme for more details.", - "ruby-cloud-env-prefix": "BIGQUERY_RESERVATION", - "ruby-cloud-product-url": "https://cloud.google.com/bigquery/docs/reference/reservations", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/.rubocop.yml b/owl-bot-staging/google-cloud-bigquery-reservation-v1/.rubocop.yml deleted file mode 100644 index 9001cc0bde65..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-bigquery-reservation-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-bigquery-reservation-v1.rb" diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/.toys.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/.toys.rb deleted file mode 100644 index 9a210f1427c7..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/.yardopts b/owl-bot-staging/google-cloud-bigquery-reservation-v1/.yardopts deleted file mode 100644 index 9fa1700ac9d1..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="BigQuery Reservation 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-bigquery-reservation-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-bigquery-reservation-v1/AUTHENTICATION.md deleted file mode 100644 index 0b1eacbc181a..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-bigquery-reservation-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-bigquery-reservation-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/bigquery/reservation/v1" - -client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/bigquery/reservation/v1" - -::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::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-bigquery-reservation-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/bigquery/reservation/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::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-bigquery-reservation-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-bigquery-reservation-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/Gemfile b/owl-bot-staging/google-cloud-bigquery-reservation-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/LICENSE.md b/owl-bot-staging/google-cloud-bigquery-reservation-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-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-bigquery-reservation-v1/README.md b/owl-bot-staging/google-cloud-bigquery-reservation-v1/README.md deleted file mode 100644 index 38259ede0f03..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the BigQuery Reservation V1 API - -A service to modify your BigQuery reservations. - -The BigQuery Reservation API provides the mechanisms by which enterprise users can provision and manage dedicated resources such as slots and BigQuery BI Engine memory allocations. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the BigQuery Reservation V1 API. Most users should consider using -the main client gem, -[google-cloud-bigquery-reservation](https://rubygems.org/gems/google-cloud-bigquery-reservation). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-bigquery-reservation-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/bigqueryreservation.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/bigquery/reservation/v1" - -client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -request = ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new # (request fields as keyword arguments...) -response = client.create_reservation request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-bigquery-reservation-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/bigquery/docs/reference/reservations) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/bigquery/reservation/v1" -require "logger" - -client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.logger = Logger.new "my-app.log" -end -``` - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-bigquery-reservation`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-bigquery-reservation-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-bigquery-reservation`. -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-bigquery-reservation-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-bigquery-reservation-v1/Rakefile b/owl-bot-staging/google-cloud-bigquery-reservation-v1/Rakefile deleted file mode 100644 index 6811c14b96be..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-bigquery-reservation-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["BIGQUERY_RESERVATION_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["BIGQUERY_RESERVATION_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["BIGQUERY_RESERVATION_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 BIGQUERY_RESERVATION_TEST_PROJECT=test123 BIGQUERY_RESERVATION_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/bigquery/reservation/v1/reservation_service/credentials" - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["BIGQUERY_RESERVATION_PROJECT"] = project - ENV["BIGQUERY_RESERVATION_TEST_PROJECT"] = project - ENV["BIGQUERY_RESERVATION_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-bigquery-reservation-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-bigquery-reservation-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-bigquery-reservation-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-bigquery-reservation-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-bigquery-reservation-v1" - header "google-cloud-bigquery-reservation-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-bigquery-reservation-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-bigquery-reservation-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-bigquery-reservation-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-bigquery-reservation-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-bigquery-reservation-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-bigquery-reservation-v1/gapic_metadata.json deleted file mode 100644 index effdec3d98a3..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/gapic_metadata.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.bigquery.reservation.v1", - "libraryPackage": "::Google::Cloud::Bigquery::Reservation::V1", - "services": { - "ReservationService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client", - "rpcs": { - "CreateReservation": { - "methods": [ - "create_reservation" - ] - }, - "ListReservations": { - "methods": [ - "list_reservations" - ] - }, - "GetReservation": { - "methods": [ - "get_reservation" - ] - }, - "DeleteReservation": { - "methods": [ - "delete_reservation" - ] - }, - "UpdateReservation": { - "methods": [ - "update_reservation" - ] - }, - "FailoverReservation": { - "methods": [ - "failover_reservation" - ] - }, - "CreateCapacityCommitment": { - "methods": [ - "create_capacity_commitment" - ] - }, - "ListCapacityCommitments": { - "methods": [ - "list_capacity_commitments" - ] - }, - "GetCapacityCommitment": { - "methods": [ - "get_capacity_commitment" - ] - }, - "DeleteCapacityCommitment": { - "methods": [ - "delete_capacity_commitment" - ] - }, - "UpdateCapacityCommitment": { - "methods": [ - "update_capacity_commitment" - ] - }, - "SplitCapacityCommitment": { - "methods": [ - "split_capacity_commitment" - ] - }, - "MergeCapacityCommitments": { - "methods": [ - "merge_capacity_commitments" - ] - }, - "CreateAssignment": { - "methods": [ - "create_assignment" - ] - }, - "ListAssignments": { - "methods": [ - "list_assignments" - ] - }, - "DeleteAssignment": { - "methods": [ - "delete_assignment" - ] - }, - "SearchAssignments": { - "methods": [ - "search_assignments" - ] - }, - "SearchAllAssignments": { - "methods": [ - "search_all_assignments" - ] - }, - "MoveAssignment": { - "methods": [ - "move_assignment" - ] - }, - "UpdateAssignment": { - "methods": [ - "update_assignment" - ] - }, - "GetBiReservation": { - "methods": [ - "get_bi_reservation" - ] - }, - "UpdateBiReservation": { - "methods": [ - "update_bi_reservation" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - }, - "CreateReservationGroup": { - "methods": [ - "create_reservation_group" - ] - }, - "GetReservationGroup": { - "methods": [ - "get_reservation_group" - ] - }, - "DeleteReservationGroup": { - "methods": [ - "delete_reservation_group" - ] - }, - "ListReservationGroups": { - "methods": [ - "list_reservation_groups" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/google-cloud-bigquery-reservation-v1.gemspec b/owl-bot-staging/google-cloud-bigquery-reservation-v1/google-cloud-bigquery-reservation-v1.gemspec deleted file mode 100644 index e0a09d200815..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/google-cloud-bigquery-reservation-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/bigquery/reservation/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-bigquery-reservation-v1" - gem.version = Google::Cloud::Bigquery::Reservation::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "The BigQuery Reservation API provides the mechanisms by which enterprise users can provision and manage dedicated resources such as slots and BigQuery BI Engine memory allocations. Note that google-cloud-bigquery-reservation-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-bigquery-reservation instead. See the readme for more details." - gem.summary = "A service to modify your BigQuery reservations." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google-cloud-bigquery-reservation-v1.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google-cloud-bigquery-reservation-v1.rb deleted file mode 100644 index c75b1a6a63a6..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google-cloud-bigquery-reservation-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/bigquery/reservation/v1" diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1.rb deleted file mode 100644 index 748152a8a78b..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/bigquery/reservation/v1/reservation_service" -require "google/cloud/bigquery/reservation/v1/version" - -module Google - module Cloud - module Bigquery - module Reservation - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/bigquery/reservation/v1" - # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/bigquery/reservation/v1" - # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - module V1 - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/bigquery/reservation/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_pb.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_pb.rb deleted file mode 100644 index af0ae70246b9..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_pb.rb +++ /dev/null @@ -1,106 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/bigquery/reservation/v1/reservation.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n6google/cloud/bigquery/reservation/v1/reservation.proto\x12$google.cloud.bigquery.reservation.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xfc\x0c\n\x0bReservation\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1a\n\rslot_capacity\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1e\n\x11ignore_idle_slots\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12S\n\tautoscale\x18\x07 \x01(\x0b\x32;.google.cloud.bigquery.reservation.v1.Reservation.AutoscaleB\x03\xe0\x41\x01\x12\x18\n\x0b\x63oncurrency\x18\x10 \x01(\x03\x42\x03\xe0\x41\x01\x12\x36\n\rcreation_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\"\n\x16multi_region_auxiliary\x18\x0e \x01(\x08\x42\x02\x18\x01\x12\x43\n\x07\x65\x64ition\x18\x11 \x01(\x0e\x32-.google.cloud.bigquery.reservation.v1.EditionB\x03\xe0\x41\x01\x12\x43\n\x10primary_location\x18\x12 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!locations.googleapis.com/Location\x12\x45\n\x12secondary_location\x18\x13 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!locations.googleapis.com/Location\x12L\n\x19original_primary_location\x18\x14 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!locations.googleapis.com/Location\x12\x1b\n\tmax_slots\x18\x15 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12X\n\x0cscaling_mode\x18\x16 \x01(\x0e\x32=.google.cloud.bigquery.reservation.v1.Reservation.ScalingModeB\x03\xe0\x41\x01\x12R\n\x06labels\x18\x17 \x03(\x0b\x32=.google.cloud.bigquery.reservation.v1.Reservation.LabelsEntryB\x03\xe0\x41\x01\x12\x1e\n\x11reservation_group\x18\x19 \x01(\tB\x03\xe0\x41\x01\x12\x64\n\x12replication_status\x18\x18 \x01(\x0b\x32\x43.google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatusB\x03\xe0\x41\x03\x12V\n\x11scheduling_policy\x18\x1b \x01(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.SchedulingPolicyB\x03\xe0\x41\x01\x1a?\n\tAutoscale\x12\x1a\n\rcurrent_slots\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x16\n\tmax_slots\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x1a\xf8\x01\n\x11ReplicationStatus\x12&\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x38\n\x0flast_error_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12>\n\x15last_replication_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x18soft_failover_start_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"c\n\x0bScalingMode\x12\x1c\n\x18SCALING_MODE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x41UTOSCALE_ONLY\x10\x01\x12\x13\n\x0fIDLE_SLOTS_ONLY\x10\x02\x12\r\n\tALL_SLOTS\x10\x03:w\xea\x41t\n.bigqueryreservation.googleapis.com/Reservation\x12\x42projects/{project}/locations/{location}/reservations/{reservation}B\x0c\n\n_max_slots\"l\n\x10SchedulingPolicy\x12\x1d\n\x0b\x63oncurrency\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1b\n\tmax_slots\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x0e\n\x0c_concurrencyB\x0c\n\n_max_slots\"\xd5\x01\n\x10ReservationGroup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08:\xad\x01\xea\x41\xa9\x01\n3bigqueryreservation.googleapis.com/ReservationGroup\x12Mprojects/{project}/locations/{location}/reservationGroups/{reservation_group}*\x11reservationGroups2\x10reservationGroup\"\xaa\x08\n\x12\x43\x61pacityCommitment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nslot_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12Z\n\x04plan\x18\x03 \x01(\x0e\x32G.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlanB\x03\xe0\x41\x01\x12R\n\x05state\x18\x04 \x01(\x0e\x32>.google.cloud.bigquery.reservation.v1.CapacityCommitment.StateB\x03\xe0\x41\x03\x12>\n\x15\x63ommitment_start_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x13\x63ommitment_end_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12/\n\x0e\x66\x61ilure_status\x18\x07 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x62\n\x0crenewal_plan\x18\x08 \x01(\x0e\x32G.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlanB\x03\xe0\x41\x01\x12\"\n\x16multi_region_auxiliary\x18\n \x01(\x08\x42\x02\x18\x01\x12\x43\n\x07\x65\x64ition\x18\x0c \x01(\x0e\x32-.google.cloud.bigquery.reservation.v1.EditionB\x03\xe0\x41\x01\x12\x19\n\x0cis_flat_rate\x18\x0e \x01(\x08\x42\x03\xe0\x41\x03\"\xca\x01\n\x0e\x43ommitmentPlan\x12\x1f\n\x1b\x43OMMITMENT_PLAN_UNSPECIFIED\x10\x00\x12\x08\n\x04\x46LEX\x10\x03\x12\x16\n\x0e\x46LEX_FLAT_RATE\x10\x07\x1a\x02\x08\x01\x12\r\n\x05TRIAL\x10\x05\x1a\x02\x08\x01\x12\x0b\n\x07MONTHLY\x10\x02\x12\x19\n\x11MONTHLY_FLAT_RATE\x10\x08\x1a\x02\x08\x01\x12\n\n\x06\x41NNUAL\x10\x04\x12\x18\n\x10\x41NNUAL_FLAT_RATE\x10\t\x1a\x02\x08\x01\x12\x0e\n\nTHREE_YEAR\x10\n\x12\x08\n\x04NONE\x10\x06\"C\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03:\x8e\x01\xea\x41\x8a\x01\n5bigqueryreservation.googleapis.com/CapacityCommitment\x12Qprojects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}\"\xc2\x01\n\x18\x43reateReservationRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.bigqueryreservation.googleapis.com/Reservation\x12\x16\n\x0ereservation_id\x18\x02 \x01(\t\x12\x46\n\x0breservation\x18\x03 \x01(\x0b\x32\x31.google.cloud.bigquery.reservation.v1.Reservation\"\x88\x01\n\x17ListReservationsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.bigqueryreservation.googleapis.com/Reservation\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"|\n\x18ListReservationsResponse\x12G\n\x0creservations\x18\x01 \x03(\x0b\x32\x31.google.cloud.bigquery.reservation.v1.Reservation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x15GetReservationRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.bigqueryreservation.googleapis.com/Reservation\"`\n\x18\x44\x65leteReservationRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.bigqueryreservation.googleapis.com/Reservation\"\x93\x01\n\x18UpdateReservationRequest\x12\x46\n\x0breservation\x18\x01 \x01(\x0b\x32\x31.google.cloud.bigquery.reservation.v1.Reservation\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xb2\x01\n\x1a\x46\x61iloverReservationRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.bigqueryreservation.googleapis.com/Reservation\x12N\n\rfailover_mode\x18\x02 \x01(\x0e\x32\x32.google.cloud.bigquery.reservation.v1.FailoverModeB\x03\xe0\x41\x01\"\xe7\x01\n\x1d\x43reateReservationGroupRequest\x12K\n\x06parent\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\x12\x33\x62igqueryreservation.googleapis.com/ReservationGroup\x12!\n\x14reservation_group_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12V\n\x11reservation_group\x18\x03 \x01(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.ReservationGroupB\x03\xe0\x41\x02\"g\n\x1aGetReservationGroupRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3bigqueryreservation.googleapis.com/ReservationGroup\"\x92\x01\n\x1cListReservationGroupsRequest\x12K\n\x06parent\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\x12\x33\x62igqueryreservation.googleapis.com/ReservationGroup\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x8c\x01\n\x1dListReservationGroupsResponse\x12R\n\x12reservation_groups\x18\x01 \x03(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.ReservationGroup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"j\n\x1d\x44\x65leteReservationGroupRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3bigqueryreservation.googleapis.com/ReservationGroup\"\x95\x02\n\x1f\x43reateCapacityCommitmentRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35\x62igqueryreservation.googleapis.com/CapacityCommitment\x12U\n\x13\x63\x61pacity_commitment\x18\x02 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12,\n$enforce_single_admin_project_per_org\x18\x04 \x01(\x08\x12\x1e\n\x16\x63\x61pacity_commitment_id\x18\x05 \x01(\t\"\x96\x01\n\x1eListCapacityCommitmentsRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35\x62igqueryreservation.googleapis.com/CapacityCommitment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x92\x01\n\x1fListCapacityCommitmentsResponse\x12V\n\x14\x63\x61pacity_commitments\x18\x01 \x03(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"k\n\x1cGetCapacityCommitmentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5bigqueryreservation.googleapis.com/CapacityCommitment\"}\n\x1f\x44\x65leteCapacityCommitmentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5bigqueryreservation.googleapis.com/CapacityCommitment\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\"\xa9\x01\n\x1fUpdateCapacityCommitmentRequest\x12U\n\x13\x63\x61pacity_commitment\x18\x01 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x81\x01\n\x1eSplitCapacityCommitmentRequest\x12K\n\x04name\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\n5bigqueryreservation.googleapis.com/CapacityCommitment\x12\x12\n\nslot_count\x18\x02 \x01(\x03\"\xb4\x01\n\x1fSplitCapacityCommitmentResponse\x12G\n\x05\x66irst\x18\x01 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\x12H\n\x06second\x18\x02 \x01(\x0b\x32\x38.google.cloud.bigquery.reservation.v1.CapacityCommitment\"\xb3\x01\n\x1fMergeCapacityCommitmentsRequest\x12J\n\x06parent\x18\x01 \x01(\tB:\xfa\x41\x37\x12\x35\x62igqueryreservation.googleapis.com/CapacityCommitment\x12\x1f\n\x17\x63\x61pacity_commitment_ids\x18\x02 \x03(\t\x12#\n\x16\x63\x61pacity_commitment_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x99\x06\n\nAssignment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08\x61ssignee\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12O\n\x08job_type\x18\x03 \x01(\x0e\x32\x38.google.cloud.bigquery.reservation.v1.Assignment.JobTypeB\x03\xe0\x41\x01\x12J\n\x05state\x18\x06 \x01(\x0e\x32\x36.google.cloud.bigquery.reservation.v1.Assignment.StateB\x03\xe0\x41\x03\x12(\n\x19\x65nable_gemini_in_bigquery\x18\n \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12V\n\x11scheduling_policy\x18\x0b \x01(\x0b\x32\x36.google.cloud.bigquery.reservation.v1.SchedulingPolicyB\x03\xe0\x41\x01\"\xdc\x01\n\x07JobType\x12\x18\n\x14JOB_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08PIPELINE\x10\x01\x12\t\n\x05QUERY\x10\x02\x12\x0f\n\x0bML_EXTERNAL\x10\x03\x12\x0e\n\nBACKGROUND\x10\x04\x12\x0e\n\nCONTINUOUS\x10\x06\x12\"\n\x1e\x42\x41\x43KGROUND_CHANGE_DATA_CAPTURE\x10\x07\x12$\n BACKGROUND_COLUMN_METADATA_INDEX\x10\x08\x12#\n\x1f\x42\x41\x43KGROUND_SEARCH_INDEX_REFRESH\x10\t\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02:\xa9\x01\xea\x41\xa5\x01\n-bigqueryreservation.googleapis.com/Assignment\x12[projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}*\x0b\x61ssignments2\nassignment\"\xbd\x01\n\x17\x43reateAssignmentRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-bigqueryreservation.googleapis.com/Assignment\x12\x44\n\nassignment\x18\x02 \x01(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x15\n\rassignment_id\x18\x04 \x01(\t\"\x86\x01\n\x16ListAssignmentsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-bigqueryreservation.googleapis.com/Assignment\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"y\n\x17ListAssignmentsResponse\x12\x45\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"^\n\x17\x44\x65leteAssignmentRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-bigqueryreservation.googleapis.com/Assignment\"\x8b\x01\n\x18SearchAssignmentsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\r\n\x05query\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"\x8e\x01\n\x1bSearchAllAssignmentsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\r\n\x05query\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"{\n\x19SearchAssignmentsResponse\x12\x45\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"~\n\x1cSearchAllAssignmentsResponse\x12\x45\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xbf\x01\n\x15MoveAssignmentRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-bigqueryreservation.googleapis.com/Assignment\x12J\n\x0e\x64\x65stination_id\x18\x03 \x01(\tB2\xfa\x41/\x12-bigqueryreservation.googleapis.com/Assignment\x12\x15\n\rassignment_id\x18\x05 \x01(\t\"\x90\x01\n\x17UpdateAssignmentRequest\x12\x44\n\nassignment\x18\x01 \x01(\x0b\x32\x30.google.cloud.bigquery.reservation.v1.Assignment\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"Y\n\x0eTableReference\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\ndataset_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08table_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xae\x02\n\rBiReservation\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04size\x18\x04 \x01(\x03\x42\x03\xe0\x41\x01\x12S\n\x10preferred_tables\x18\x05 \x03(\x0b\x32\x34.google.cloud.bigquery.reservation.v1.TableReferenceB\x03\xe0\x41\x01:l\xea\x41i\n0bigqueryreservation.googleapis.com/BiReservation\x12\x35projects/{project}/locations/{location}/biReservation\"a\n\x17GetBiReservationRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0bigqueryreservation.googleapis.com/BiReservation\"\x9a\x01\n\x1aUpdateBiReservationRequest\x12K\n\x0e\x62i_reservation\x18\x01 \x01(\x0b\x32\x33.google.cloud.bigquery.reservation.v1.BiReservation\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask*U\n\x07\x45\x64ition\x12\x17\n\x13\x45\x44ITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x0e\n\nENTERPRISE\x10\x02\x12\x13\n\x0f\x45NTERPRISE_PLUS\x10\x03*A\n\x0c\x46\x61iloverMode\x12\x1d\n\x19\x46\x41ILOVER_MODE_UNSPECIFIED\x10\x00\x12\x08\n\x04SOFT\x10\x01\x12\x08\n\x04HARD\x10\x02\x32\xa3\x36\n\x12ReservationService\x12\xf1\x01\n\x11\x43reateReservation\x12>.google.cloud.bigquery.reservation.v1.CreateReservationRequest\x1a\x31.google.cloud.bigquery.reservation.v1.Reservation\"i\xda\x41!parent,reservation,reservation_id\x82\xd3\xe4\x93\x02?\"0/v1/{parent=projects/*/locations/*}/reservations:\x0breservation\x12\xd4\x01\n\x10ListReservations\x12=.google.cloud.bigquery.reservation.v1.ListReservationsRequest\x1a>.google.cloud.bigquery.reservation.v1.ListReservationsResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{parent=projects/*/locations/*}/reservations\x12\xc1\x01\n\x0eGetReservation\x12;.google.cloud.bigquery.reservation.v1.GetReservationRequest\x1a\x31.google.cloud.bigquery.reservation.v1.Reservation\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{name=projects/*/locations/*/reservations/*}\x12\xac\x01\n\x11\x44\x65leteReservation\x12>.google.cloud.bigquery.reservation.v1.DeleteReservationRequest\x1a\x16.google.protobuf.Empty\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32*0/v1/{name=projects/*/locations/*/reservations/*}\x12\xf3\x01\n\x11UpdateReservation\x12>.google.cloud.bigquery.reservation.v1.UpdateReservationRequest\x1a\x31.google.cloud.bigquery.reservation.v1.Reservation\"k\xda\x41\x17reservation,update_mask\x82\xd3\xe4\x93\x02K2/v1/{parent=projects/*/locations/*/reservations/*}/assignments:\nassignment\x12\xdf\x01\n\x0fListAssignments\x12<.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest\x1a=.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1/{parent=projects/*/locations/*/reservations/*}/assignments\x12\xb8\x01\n\x10\x44\x65leteAssignment\x12=.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest\x1a\x16.google.protobuf.Empty\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@*>/v1/{name=projects/*/locations/*/reservations/*/assignments/*}\x12\xe5\x01\n\x11SearchAssignments\x12>.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest\x1a?.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse\"O\x88\x02\x01\xda\x41\x0cparent,query\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*}:searchAssignments\x12\xee\x01\n\x14SearchAllAssignments\x12\x41.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest\x1a\x42.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse\"O\xda\x41\x0cparent,query\x82\xd3\xe4\x93\x02:\x12\x38/v1/{parent=projects/*/locations/*}:searchAllAssignments\x12\xe5\x01\n\x0eMoveAssignment\x12;.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest\x1a\x30.google.cloud.bigquery.reservation.v1.Assignment\"d\xda\x41\x13name,destination_id\x82\xd3\xe4\x93\x02H\"C/v1/{name=projects/*/locations/*/reservations/*/assignments/*}:move:\x01*\x12\xfb\x01\n\x10UpdateAssignment\x12=.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest\x1a\x30.google.cloud.bigquery.reservation.v1.Assignment\"v\xda\x41\x16\x61ssignment,update_mask\x82\xd3\xe4\x93\x02W2I/v1/{assignment.name=projects/*/locations/*/reservations/*/assignments/*}:\nassignment\x12\xc6\x01\n\x10GetBiReservation\x12=.google.cloud.bigquery.reservation.v1.GetBiReservationRequest\x1a\x33.google.cloud.bigquery.reservation.v1.BiReservation\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v1/{name=projects/*/locations/*/biReservation}\x12\x81\x02\n\x13UpdateBiReservation\x12@.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest\x1a\x33.google.cloud.bigquery.reservation.v1.BiReservation\"s\xda\x41\x1a\x62i_reservation,update_mask\x82\xd3\xe4\x93\x02P2>/v1/{bi_reservation.name=projects/*/locations/*/biReservation}:\x0e\x62i_reservation\x12\xf4\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xa8\x01\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x96\x01\x12\x41/v1/{resource=projects/*/locations/*/reservations/*}:getIamPolicyZQ\x12O/v1/{resource=projects/*/locations/*/reservations/*/assignments/*}:getIamPolicy\x12\x81\x02\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xb5\x01\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x9c\x01\"A/v1/{resource=projects/*/locations/*/reservations/*}:setIamPolicy:\x01*ZT\"O/v1/{resource=projects/*/locations/*/reservations/*/assignments/*}:setIamPolicy:\x01*\x12\x9b\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\xaf\x01\x82\xd3\xe4\x93\x02\xa8\x01\"G/v1/{resource=projects/*/locations/*/reservations/*}:testIamPermissions:\x01*ZZ\"U/v1/{resource=projects/*/locations/*/reservations/*/assignments/*}:testIamPermissions:\x01*\x12\xe7\x01\n\x16\x43reateReservationGroup\x12\x43.google.cloud.bigquery.reservation.v1.CreateReservationGroupRequest\x1a\x36.google.cloud.bigquery.reservation.v1.ReservationGroup\"P\x82\xd3\xe4\x93\x02J\"5/v1/{parent=projects/*/locations/*}/reservationGroups:\x11reservation_group\x12\xd5\x01\n\x13GetReservationGroup\x12@.google.cloud.bigquery.reservation.v1.GetReservationGroupRequest\x1a\x36.google.cloud.bigquery.reservation.v1.ReservationGroup\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/reservationGroups/*}\x12\xbb\x01\n\x16\x44\x65leteReservationGroup\x12\x43.google.cloud.bigquery.reservation.v1.DeleteReservationGroupRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v1/{name=projects/*/locations/*/reservationGroups/*}\x12\xe8\x01\n\x15ListReservationGroups\x12\x42.google.cloud.bigquery.reservation.v1.ListReservationGroupsRequest\x1a\x43.google.cloud.bigquery.reservation.v1.ListReservationGroupsResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*}/reservationGroups\x1a\x7f\xca\x41\"bigqueryreservation.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platformB\xd8\x01\n(com.google.cloud.bigquery.reservation.v1B\x10ReservationProtoP\x01ZJcloud.google.com/go/bigquery/reservation/apiv1/reservationpb;reservationpb\xaa\x02$Google.Cloud.BigQuery.Reservation.V1\xca\x02$Google\\Cloud\\BigQuery\\Reservation\\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.rpc.Status", "google/rpc/status.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.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 Bigquery - module Reservation - module V1 - Reservation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Reservation").msgclass - Reservation::Autoscale = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Reservation.Autoscale").msgclass - Reservation::ReplicationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus").msgclass - Reservation::ScalingMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Reservation.ScalingMode").enummodule - SchedulingPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.SchedulingPolicy").msgclass - ReservationGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ReservationGroup").msgclass - CapacityCommitment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.CapacityCommitment").msgclass - CapacityCommitment::CommitmentPlan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan").enummodule - CapacityCommitment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.CapacityCommitment.State").enummodule - CreateReservationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.CreateReservationRequest").msgclass - ListReservationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListReservationsRequest").msgclass - ListReservationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListReservationsResponse").msgclass - GetReservationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.GetReservationRequest").msgclass - DeleteReservationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.DeleteReservationRequest").msgclass - UpdateReservationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.UpdateReservationRequest").msgclass - FailoverReservationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.FailoverReservationRequest").msgclass - CreateReservationGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.CreateReservationGroupRequest").msgclass - GetReservationGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.GetReservationGroupRequest").msgclass - ListReservationGroupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListReservationGroupsRequest").msgclass - ListReservationGroupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListReservationGroupsResponse").msgclass - DeleteReservationGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.DeleteReservationGroupRequest").msgclass - CreateCapacityCommitmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest").msgclass - ListCapacityCommitmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest").msgclass - ListCapacityCommitmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse").msgclass - GetCapacityCommitmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest").msgclass - DeleteCapacityCommitmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest").msgclass - UpdateCapacityCommitmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest").msgclass - SplitCapacityCommitmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest").msgclass - SplitCapacityCommitmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse").msgclass - MergeCapacityCommitmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest").msgclass - Assignment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Assignment").msgclass - Assignment::JobType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Assignment.JobType").enummodule - Assignment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Assignment.State").enummodule - CreateAssignmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.CreateAssignmentRequest").msgclass - ListAssignmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListAssignmentsRequest").msgclass - ListAssignmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.ListAssignmentsResponse").msgclass - DeleteAssignmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest").msgclass - SearchAssignmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest").msgclass - SearchAllAssignmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest").msgclass - SearchAssignmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse").msgclass - SearchAllAssignmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse").msgclass - MoveAssignmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.MoveAssignmentRequest").msgclass - UpdateAssignmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest").msgclass - TableReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.TableReference").msgclass - BiReservation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.BiReservation").msgclass - GetBiReservationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.GetBiReservationRequest").msgclass - UpdateBiReservationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest").msgclass - Edition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.Edition").enummodule - FailoverMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.reservation.v1.FailoverMode").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service.rb deleted file mode 100644 index b3b9c9d8284d..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/bigquery/reservation/v1/version" - -require "google/cloud/bigquery/reservation/v1/reservation_service/credentials" -require "google/cloud/bigquery/reservation/v1/reservation_service/paths" -require "google/cloud/bigquery/reservation/v1/reservation_service/client" -require "google/cloud/bigquery/reservation/v1/reservation_service/rest" - -module Google - module Cloud - module Bigquery - module Reservation - module V1 - ## - # This API allows users to manage their BigQuery reservations. - # - # A reservation provides computational resource guarantees, in the form of - # [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a - # unit of computational power in BigQuery, and serves as the basic unit of - # parallelism. In a scan of a multi-partitioned table, a single slot operates - # on a single partition of the table. A reservation resource exists as a child - # resource of the admin project and location, e.g.: - # `projects/myproject/locations/US/reservations/reservationName`. - # - # A capacity commitment is a way to purchase compute capacity for BigQuery jobs - # (in the form of slots) with some committed period of usage. A capacity - # commitment resource exists as a child resource of the admin project and - # location, e.g.: - # `projects/myproject/locations/US/capacityCommitments/id`. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/bigquery/reservation/v1/reservation_service" - # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/bigquery/reservation/v1/reservation_service/rest" - # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - module ReservationService - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "reservation_service", "helpers.rb" -require "google/cloud/bigquery/reservation/v1/reservation_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/client.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/client.rb deleted file mode 100644 index 8b56210e38fb..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/client.rb +++ /dev/null @@ -1,3514 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/bigquery/reservation/v1/reservation_pb" - -module Google - module Cloud - module Bigquery - module Reservation - module V1 - module ReservationService - ## - # Client for the ReservationService service. - # - # This API allows users to manage their BigQuery reservations. - # - # A reservation provides computational resource guarantees, in the form of - # [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a - # unit of computational power in BigQuery, and serves as the basic unit of - # parallelism. In a scan of a multi-partitioned table, a single slot operates - # on a single partition of the table. A reservation resource exists as a child - # resource of the admin project and location, e.g.: - # `projects/myproject/locations/US/reservations/reservationName`. - # - # A capacity commitment is a way to purchase compute capacity for BigQuery jobs - # (in the form of slots) with some committed period of usage. A capacity - # commitment resource exists as a child resource of the admin project and - # location, e.g.: - # `projects/myproject/locations/US/capacityCommitments/id`. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "bigqueryreservation.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :reservation_service_stub - - ## - # Configure the ReservationService Client class. - # - # See {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ReservationService clients - # ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::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", "Bigquery", "Reservation", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_reservation.timeout = 300.0 - - default_config.rpcs.list_reservations.timeout = 300.0 - default_config.rpcs.list_reservations.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_reservation.timeout = 300.0 - default_config.rpcs.get_reservation.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.delete_reservation.timeout = 300.0 - default_config.rpcs.delete_reservation.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_reservation.timeout = 300.0 - - default_config.rpcs.failover_reservation.timeout = 300.0 - - default_config.rpcs.create_capacity_commitment.timeout = 300.0 - - default_config.rpcs.list_capacity_commitments.timeout = 300.0 - default_config.rpcs.list_capacity_commitments.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_capacity_commitment.timeout = 300.0 - default_config.rpcs.get_capacity_commitment.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.delete_capacity_commitment.timeout = 300.0 - default_config.rpcs.delete_capacity_commitment.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_capacity_commitment.timeout = 300.0 - - default_config.rpcs.split_capacity_commitment.timeout = 300.0 - - default_config.rpcs.merge_capacity_commitments.timeout = 300.0 - - default_config.rpcs.create_assignment.timeout = 300.0 - - default_config.rpcs.list_assignments.timeout = 300.0 - default_config.rpcs.list_assignments.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.delete_assignment.timeout = 300.0 - default_config.rpcs.delete_assignment.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_assignments.timeout = 300.0 - default_config.rpcs.search_assignments.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.move_assignment.timeout = 300.0 - - default_config.rpcs.get_bi_reservation.timeout = 300.0 - default_config.rpcs.get_bi_reservation.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_bi_reservation.timeout = 300.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ReservationService 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::Bigquery::Reservation::V1::ReservationService::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 - @reservation_service_stub.universe_domain - end - - ## - # Create a new ReservationService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ReservationService 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/cloud/bigquery/reservation/v1/reservation_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 - - @reservation_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @reservation_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @reservation_service_stub.logger - end - - # Service calls - - ## - # Creates a new reservation resource. - # - # @overload create_reservation(request, options = nil) - # Pass arguments to `create_reservation` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_reservation(parent: nil, reservation_id: nil, reservation: nil) - # Pass arguments to `create_reservation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Project, location. E.g., - # `projects/myproject/locations/US` - # @param reservation_id [::String] - # The reservation ID. It must only contain lower case alphanumeric - # characters or dashes. It must start with a letter and must not end - # with a dash. Its maximum length is 64 characters. - # @param reservation [::Google::Cloud::Bigquery::Reservation::V1::Reservation, ::Hash] - # Definition of the new reservation to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new - # - # # Call the create_reservation method. - # result = client.create_reservation request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. - # p result - # - def create_reservation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_reservation.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_reservation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_reservation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :create_reservation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the reservations for the project in the specified location. - # - # @overload list_reservations(request, options = nil) - # Pass arguments to `list_reservations` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_reservations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_reservations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name containing project and location, e.g.: - # `projects/myproject/locations/US` - # @param page_size [::Integer] - # The maximum number of items to return per page. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Reservation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Reservation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new - # - # # Call the list_reservations method. - # result = client.list_reservations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Reservation. - # p item - # end - # - def list_reservations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_reservations.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_reservations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_reservations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :list_reservations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @reservation_service_stub, :list_reservations, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns information about the reservation. - # - # @overload get_reservation(request, options = nil) - # Pass arguments to `get_reservation` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_reservation(name: nil) - # Pass arguments to `get_reservation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the reservation to retrieve. E.g., - # `projects/myproject/locations/US/reservations/team1-prod` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new - # - # # Call the get_reservation method. - # result = client.get_reservation request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. - # p result - # - def get_reservation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_reservation.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_reservation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_reservation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :get_reservation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a reservation. - # Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has - # assignments. - # - # @overload delete_reservation(request, options = nil) - # Pass arguments to `delete_reservation` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_reservation(name: nil) - # Pass arguments to `delete_reservation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the reservation to retrieve. E.g., - # `projects/myproject/locations/US/reservations/team1-prod` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new - # - # # Call the delete_reservation method. - # result = client.delete_reservation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_reservation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_reservation.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_reservation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_reservation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :delete_reservation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an existing reservation resource. - # - # @overload update_reservation(request, options = nil) - # Pass arguments to `update_reservation` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_reservation(reservation: nil, update_mask: nil) - # Pass arguments to `update_reservation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param reservation [::Google::Cloud::Bigquery::Reservation::V1::Reservation, ::Hash] - # Content of the reservation to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Standard field mask for the set of fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new - # - # # Call the update_reservation method. - # result = client.update_reservation request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. - # p result - # - def update_reservation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_reservation.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::Bigquery::Reservation::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.reservation&.name - header_params["reservation.name"] = request.reservation.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_reservation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_reservation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :update_reservation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Fail over a reservation to the secondary location. The operation should be - # done in the current secondary location, which will be promoted to the - # new primary location for the reservation. - # Attempting to failover a reservation in the current primary location will - # fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. - # - # @overload failover_reservation(request, options = nil) - # Pass arguments to `failover_reservation` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload failover_reservation(name: nil, failover_mode: nil) - # Pass arguments to `failover_reservation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the reservation to failover. E.g., - # `projects/myproject/locations/US/reservations/team1-prod` - # @param failover_mode [::Google::Cloud::Bigquery::Reservation::V1::FailoverMode] - # Optional. A parameter that determines how writes that are pending - # replication are handled after a failover is initiated. If not specified, - # HARD failover mode is used by default. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest.new - # - # # Call the failover_reservation method. - # result = client.failover_reservation request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. - # p result - # - def failover_reservation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest - - # Converts hash 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.failover_reservation.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.failover_reservation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.failover_reservation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :failover_reservation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new capacity commitment resource. - # - # @overload create_capacity_commitment(request, options = nil) - # Pass arguments to `create_capacity_commitment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_capacity_commitment(parent: nil, capacity_commitment: nil, enforce_single_admin_project_per_org: nil, capacity_commitment_id: nil) - # Pass arguments to `create_capacity_commitment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the parent reservation. E.g., - # `projects/myproject/locations/US` - # @param capacity_commitment [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment, ::Hash] - # Content of the capacity commitment to create. - # @param enforce_single_admin_project_per_org [::Boolean] - # If true, fail the request if another project in the organization has a - # capacity commitment. - # @param capacity_commitment_id [::String] - # The optional capacity commitment ID. Capacity commitment name will be - # generated automatically if this field is empty. - # This field must only contain lower case alphanumeric characters or dashes. - # The first and last character cannot be a dash. Max length is 64 characters. - # NOTE: this ID won't be kept if the capacity commitment is split or merged. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new - # - # # Call the create_capacity_commitment method. - # result = client.create_capacity_commitment request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - # p result - # - def create_capacity_commitment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_capacity_commitment.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_capacity_commitment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_capacity_commitment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :create_capacity_commitment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the capacity commitments for the admin project. - # - # @overload list_capacity_commitments(request, options = nil) - # Pass arguments to `list_capacity_commitments` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_capacity_commitments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_capacity_commitments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the parent reservation. E.g., - # `projects/myproject/locations/US` - # @param page_size [::Integer] - # The maximum number of items to return. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new - # - # # Call the list_capacity_commitments method. - # result = client.list_capacity_commitments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - # p item - # end - # - def list_capacity_commitments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_capacity_commitments.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_capacity_commitments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_capacity_commitments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :list_capacity_commitments, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @reservation_service_stub, :list_capacity_commitments, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns information about the capacity commitment. - # - # @overload get_capacity_commitment(request, options = nil) - # Pass arguments to `get_capacity_commitment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_capacity_commitment(name: nil) - # Pass arguments to `get_capacity_commitment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the capacity commitment to retrieve. E.g., - # `projects/myproject/locations/US/capacityCommitments/123` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new - # - # # Call the get_capacity_commitment method. - # result = client.get_capacity_commitment request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - # p result - # - def get_capacity_commitment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_capacity_commitment.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_capacity_commitment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_capacity_commitment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :get_capacity_commitment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a capacity commitment. Attempting to delete capacity commitment - # before its commitment_end_time will fail with the error code - # `google.rpc.Code.FAILED_PRECONDITION`. - # - # @overload delete_capacity_commitment(request, options = nil) - # Pass arguments to `delete_capacity_commitment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_capacity_commitment(name: nil, force: nil) - # Pass arguments to `delete_capacity_commitment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the capacity commitment to delete. E.g., - # `projects/myproject/locations/US/capacityCommitments/123` - # @param force [::Boolean] - # Can be used to force delete commitments even if assignments exist. Deleting - # commitments with assignments may cause queries to fail if they no longer - # have access to slots. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new - # - # # Call the delete_capacity_commitment method. - # result = client.delete_capacity_commitment request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_capacity_commitment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_capacity_commitment.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_capacity_commitment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_capacity_commitment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :delete_capacity_commitment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an existing capacity commitment. - # - # Only `plan` and `renewal_plan` fields can be updated. - # - # Plan can only be changed to a plan of a longer commitment period. - # Attempting to change to a plan with shorter commitment period will fail - # with the error code `google.rpc.Code.FAILED_PRECONDITION`. - # - # @overload update_capacity_commitment(request, options = nil) - # Pass arguments to `update_capacity_commitment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_capacity_commitment(capacity_commitment: nil, update_mask: nil) - # Pass arguments to `update_capacity_commitment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param capacity_commitment [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment, ::Hash] - # Content of the capacity commitment to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Standard field mask for the set of fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new - # - # # Call the update_capacity_commitment method. - # result = client.update_capacity_commitment request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - # p result - # - def update_capacity_commitment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_capacity_commitment.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::Bigquery::Reservation::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.capacity_commitment&.name - header_params["capacity_commitment.name"] = request.capacity_commitment.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_capacity_commitment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_capacity_commitment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :update_capacity_commitment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Splits capacity commitment to two commitments of the same plan and - # `commitment_end_time`. - # - # A common use case is to enable downgrading commitments. - # - # For example, in order to downgrade from 10000 slots to 8000, you might - # split a 10000 capacity commitment into commitments of 2000 and 8000. Then, - # you delete the first one after the commitment end time passes. - # - # @overload split_capacity_commitment(request, options = nil) - # Pass arguments to `split_capacity_commitment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload split_capacity_commitment(name: nil, slot_count: nil) - # Pass arguments to `split_capacity_commitment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name e.g.,: - # `projects/myproject/locations/US/capacityCommitments/123` - # @param slot_count [::Integer] - # Number of slots in the capacity commitment after the split. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new - # - # # Call the split_capacity_commitment method. - # result = client.split_capacity_commitment request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse. - # p result - # - def split_capacity_commitment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest - - # Converts hash 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.split_capacity_commitment.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.split_capacity_commitment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.split_capacity_commitment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :split_capacity_commitment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Merges capacity commitments of the same plan into a single commitment. - # - # The resulting capacity commitment has the greater commitment_end_time - # out of the to-be-merged capacity commitments. - # - # Attempting to merge capacity commitments of different plan will fail - # with the error code `google.rpc.Code.FAILED_PRECONDITION`. - # - # @overload merge_capacity_commitments(request, options = nil) - # Pass arguments to `merge_capacity_commitments` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload merge_capacity_commitments(parent: nil, capacity_commitment_ids: nil, capacity_commitment_id: nil) - # Pass arguments to `merge_capacity_commitments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Parent resource that identifies admin project and location e.g., - # `projects/myproject/locations/us` - # @param capacity_commitment_ids [::Array<::String>] - # Ids of capacity commitments to merge. - # These capacity commitments must exist under admin project and location - # specified in the parent. - # ID is the last portion of capacity commitment name e.g., 'abc' for - # projects/myproject/locations/US/capacityCommitments/abc - # @param capacity_commitment_id [::String] - # Optional. The optional resulting capacity commitment ID. Capacity - # commitment name will be generated automatically if this field is empty. - # This field must only contain lower case alphanumeric characters or dashes. - # The first and last character cannot be a dash. Max length is 64 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new - # - # # Call the merge_capacity_commitments method. - # result = client.merge_capacity_commitments request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - # p result - # - def merge_capacity_commitments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest - - # Converts hash 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.merge_capacity_commitments.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.merge_capacity_commitments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.merge_capacity_commitments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :merge_capacity_commitments, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an assignment object which allows the given project to submit jobs - # of a certain type using slots from the specified reservation. - # - # Currently a - # resource (project, folder, organization) can only have one assignment per - # each (job_type, location) combination, and that reservation will be used - # for all jobs of the matching type. - # - # Different assignments can be created on different levels of the - # projects, folders or organization hierarchy. During query execution, - # the assignment is looked up at the project, folder and organization levels - # in that order. The first assignment found is applied to the query. - # - # When creating assignments, it does not matter if other assignments exist at - # higher levels. - # - # Example: - # - # * The organization `organizationA` contains two projects, `project1` - # and `project2`. - # * Assignments for all three entities (`organizationA`, `project1`, and - # `project2`) could all be created and mapped to the same or different - # reservations. - # - # "None" assignments represent an absence of the assignment. Projects - # assigned to None use on-demand pricing. To create a "None" assignment, use - # "none" as a reservation_id in the parent. Example parent: - # `projects/myproject/locations/US/reservations/none`. - # - # Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have - # 'bigquery.admin' permissions on the project using the reservation - # and the project that owns this reservation. - # - # Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment - # does not match location of the reservation. - # - # @overload create_assignment(request, options = nil) - # Pass arguments to `create_assignment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_assignment(parent: nil, assignment: nil, assignment_id: nil) - # Pass arguments to `create_assignment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name of the assignment - # E.g. `projects/myproject/locations/US/reservations/team1-prod` - # @param assignment [::Google::Cloud::Bigquery::Reservation::V1::Assignment, ::Hash] - # Assignment resource to create. - # @param assignment_id [::String] - # The optional assignment ID. Assignment name will be generated automatically - # if this field is empty. - # This field must only contain lower case alphanumeric characters or dashes. - # Max length is 64 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new - # - # # Call the create_assignment method. - # result = client.create_assignment request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. - # p result - # - def create_assignment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_assignment.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_assignment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_assignment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :create_assignment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists assignments. - # - # Only explicitly created assignments will be returned. - # - # Example: - # - # * Organization `organizationA` contains two projects, `project1` and - # `project2`. - # * Reservation `res1` exists and was created previously. - # * CreateAssignment was used previously to define the following - # associations between entities and reservations: `` - # and `` - # - # In this example, ListAssignments will just return the above two assignments - # for reservation `res1`, and no expansion/merge will happen. - # - # The wildcard "-" can be used for - # reservations in the request. In that case all assignments belongs to the - # specified project and location will be listed. - # - # **Note** "-" cannot be used for projects nor locations. - # - # @overload list_assignments(request, options = nil) - # Pass arguments to `list_assignments` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_assignments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_assignments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name e.g.: - # - # `projects/myproject/locations/US/reservations/team1-prod` - # - # Or: - # - # `projects/myproject/locations/US/reservations/-` - # @param page_size [::Integer] - # The maximum number of items to return per page. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new - # - # # Call the list_assignments method. - # result = client.list_assignments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. - # p item - # end - # - def list_assignments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_assignments.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_assignments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_assignments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :list_assignments, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @reservation_service_stub, :list_assignments, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a assignment. No expansion will happen. - # - # Example: - # - # * Organization `organizationA` contains two projects, `project1` and - # `project2`. - # * Reservation `res1` exists and was created previously. - # * CreateAssignment was used previously to define the following - # associations between entities and reservations: `` - # and `` - # - # In this example, deletion of the `` assignment won't - # affect the other assignment ``. After said deletion, - # queries from `project1` will still use `res1` while queries from - # `project2` will switch to use on-demand mode. - # - # @overload delete_assignment(request, options = nil) - # Pass arguments to `delete_assignment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_assignment(name: nil) - # Pass arguments to `delete_assignment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource, e.g. - # `projects/myproject/locations/US/reservations/team1-prod/assignments/123` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new - # - # # Call the delete_assignment method. - # result = client.delete_assignment request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_assignment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_assignment.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_assignment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_assignment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :delete_assignment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deprecated: Looks up assignments for a specified resource for a particular - # region. If the request is about a project: - # - # 1. Assignments created on the project will be returned if they exist. - # 2. Otherwise assignments created on the closest ancestor will be - # returned. - # 3. Assignments for different JobTypes will all be returned. - # - # The same logic applies if the request is about a folder. - # - # If the request is about an organization, then assignments created on the - # organization will be returned (organization doesn't have ancestors). - # - # Comparing to ListAssignments, there are some behavior - # differences: - # - # 1. permission on the assignee will be verified in this API. - # 2. Hierarchy lookup (project->folder->organization) happens in this API. - # 3. Parent here is `projects/*/locations/*`, instead of - # `projects/*/locations/*reservations/*`. - # - # **Note** "-" cannot be used for projects - # nor locations. - # - # @deprecated This method is deprecated and may be removed in the next major version update. - # - # @overload search_assignments(request, options = nil) - # Pass arguments to `search_assignments` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search_assignments(parent: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_assignments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the admin project(containing project and - # location), e.g.: - # `projects/myproject/locations/US`. - # @param query [::String] - # Please specify resource name as assignee in the query. - # - # Examples: - # - # * `assignee=projects/myproject` - # * `assignee=folders/123` - # * `assignee=organizations/456` - # @param page_size [::Integer] - # The maximum number of items to return per page. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new - # - # # Call the search_assignments method. - # result = client.search_assignments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. - # p item - # end - # - def search_assignments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest - - # Converts hash 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.search_assignments.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.search_assignments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_assignments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :search_assignments, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @reservation_service_stub, :search_assignments, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Looks up assignments for a specified resource for a particular region. - # If the request is about a project: - # - # 1. Assignments created on the project will be returned if they exist. - # 2. Otherwise assignments created on the closest ancestor will be - # returned. - # 3. Assignments for different JobTypes will all be returned. - # - # The same logic applies if the request is about a folder. - # - # If the request is about an organization, then assignments created on the - # organization will be returned (organization doesn't have ancestors). - # - # Comparing to ListAssignments, there are some behavior - # differences: - # - # 1. permission on the assignee will be verified in this API. - # 2. Hierarchy lookup (project->folder->organization) happens in this API. - # 3. Parent here is `projects/*/locations/*`, instead of - # `projects/*/locations/*reservations/*`. - # - # @overload search_all_assignments(request, options = nil) - # Pass arguments to `search_all_assignments` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search_all_assignments(parent: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_all_assignments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name with location (project name could be the - # wildcard '-'), e.g.: - # `projects/-/locations/US`. - # @param query [::String] - # Please specify resource name as assignee in the query. - # - # Examples: - # - # * `assignee=projects/myproject` - # * `assignee=folders/123` - # * `assignee=organizations/456` - # @param page_size [::Integer] - # The maximum number of items to return per page. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new - # - # # Call the search_all_assignments method. - # result = client.search_all_assignments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. - # p item - # end - # - def search_all_assignments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest - - # Converts hash 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.search_all_assignments.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.search_all_assignments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_all_assignments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :search_all_assignments, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @reservation_service_stub, :search_all_assignments, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Moves an assignment under a new reservation. - # - # This differs from removing an existing assignment and recreating a new one - # by providing a transactional change that ensures an assignee always has an - # associated reservation. - # - # @overload move_assignment(request, options = nil) - # Pass arguments to `move_assignment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload move_assignment(name: nil, destination_id: nil, assignment_id: nil) - # Pass arguments to `move_assignment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the assignment, - # e.g. - # `projects/myproject/locations/US/reservations/team1-prod/assignments/123` - # @param destination_id [::String] - # The new reservation ID, e.g.: - # `projects/myotherproject/locations/US/reservations/team2-prod` - # @param assignment_id [::String] - # The optional assignment ID. A new assignment name is generated if this - # field is empty. - # - # This field can contain only lowercase alphanumeric characters or dashes. - # Max length is 64 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new - # - # # Call the move_assignment method. - # result = client.move_assignment request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. - # p result - # - def move_assignment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.move_assignment.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.move_assignment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.move_assignment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :move_assignment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an existing assignment. - # - # Only the `priority` field can be updated. - # - # @overload update_assignment(request, options = nil) - # Pass arguments to `update_assignment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_assignment(assignment: nil, update_mask: nil) - # Pass arguments to `update_assignment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param assignment [::Google::Cloud::Bigquery::Reservation::V1::Assignment, ::Hash] - # Content of the assignment to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Standard field mask for the set of fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new - # - # # Call the update_assignment method. - # result = client.update_assignment request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. - # p result - # - def update_assignment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_assignment.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::Bigquery::Reservation::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.assignment&.name - header_params["assignment.name"] = request.assignment.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_assignment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_assignment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :update_assignment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a BI reservation. - # - # @overload get_bi_reservation(request, options = nil) - # Pass arguments to `get_bi_reservation` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_bi_reservation(name: nil) - # Pass arguments to `get_bi_reservation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the requested reservation, for example: - # `projects/{project_id}/locations/{location_id}/biReservation` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new - # - # # Call the get_bi_reservation method. - # result = client.get_bi_reservation request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. - # p result - # - def get_bi_reservation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_bi_reservation.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_bi_reservation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_bi_reservation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :get_bi_reservation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a BI reservation. - # - # Only fields specified in the `field_mask` are updated. - # - # A singleton BI reservation always exists with default size 0. - # In order to reserve BI capacity it needs to be updated to an amount - # greater than 0. In order to release BI capacity reservation size - # must be set to 0. - # - # @overload update_bi_reservation(request, options = nil) - # Pass arguments to `update_bi_reservation` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_bi_reservation(bi_reservation: nil, update_mask: nil) - # Pass arguments to `update_bi_reservation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param bi_reservation [::Google::Cloud::Bigquery::Reservation::V1::BiReservation, ::Hash] - # A reservation to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A list of fields to be updated in this request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new - # - # # Call the update_bi_reservation method. - # result = client.update_bi_reservation request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. - # p result - # - def update_bi_reservation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_bi_reservation.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::Bigquery::Reservation::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.bi_reservation&.name - header_params["bi_reservation.name"] = request.bi_reservation.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_bi_reservation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_bi_reservation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :update_bi_reservation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a resource. - # May return: - # - # * A`NOT_FOUND` error if the resource doesn't exist or you don't have the - # permission to view it. - # * An empty policy if the resource exists but doesn't have a set policy. - # - # Supported resources are: - # - Reservations - # - ReservationAssignments - # - # To call this method, you must have the following Google IAM permissions: - # - # - `bigqueryreservation.reservations.getIamPolicy` to get policies on - # reservations. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets an access control policy for a resource. Replaces any existing - # policy. - # - # Supported resources are: - # - Reservations - # - # To call this method, you must have the following Google IAM permissions: - # - # - `bigqueryreservation.reservations.setIamPolicy` to set policies on - # reservations. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets your permissions on a resource. Returns an empty set of permissions if - # the resource doesn't exist. - # - # Supported resources are: - # - Reservations - # - # No Google IAM permissions are required to call this method. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new reservation group. - # - # @overload create_reservation_group(request, options = nil) - # Pass arguments to `create_reservation_group` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_reservation_group(parent: nil, reservation_group_id: nil, reservation_group: nil) - # Pass arguments to `create_reservation_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Project, location. E.g., - # `projects/myproject/locations/US` - # @param reservation_group_id [::String] - # Required. The reservation group ID. It must only contain lower case - # alphanumeric characters or dashes. It must start with a letter and must not - # end with a dash. Its maximum length is 64 characters. - # @param reservation_group [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup, ::Hash] - # Required. New Reservation Group to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest.new - # - # # Call the create_reservation_group method. - # result = client.create_reservation_group request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. - # p result - # - def create_reservation_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_reservation_group.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_reservation_group.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_reservation_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :create_reservation_group, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns information about the reservation group. - # - # @overload get_reservation_group(request, options = nil) - # Pass arguments to `get_reservation_group` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_reservation_group(name: nil) - # Pass arguments to `get_reservation_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the reservation group to retrieve. E.g., - # `projects/myproject/locations/US/reservationGroups/team1-prod` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest.new - # - # # Call the get_reservation_group method. - # result = client.get_reservation_group request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. - # p result - # - def get_reservation_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_reservation_group.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_reservation_group.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_reservation_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :get_reservation_group, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a reservation. - # Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has - # assignments. - # - # @overload delete_reservation_group(request, options = nil) - # Pass arguments to `delete_reservation_group` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_reservation_group(name: nil) - # Pass arguments to `delete_reservation_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the reservation group to retrieve. E.g., - # `projects/myproject/locations/US/reservationGroups/team1-prod` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest.new - # - # # Call the delete_reservation_group method. - # result = client.delete_reservation_group request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_reservation_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_reservation_group.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_reservation_group.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_reservation_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :delete_reservation_group, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the reservation groups for the project in the specified location. - # - # @overload list_reservation_groups(request, options = nil) - # Pass arguments to `list_reservation_groups` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_reservation_groups(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_reservation_groups` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name containing project and location, e.g.: - # `projects/myproject/locations/US` - # @param page_size [::Integer] - # The maximum number of items to return per page. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest.new - # - # # Call the list_reservation_groups method. - # result = client.list_reservation_groups request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. - # p item - # end - # - def list_reservation_groups request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_reservation_groups.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::Bigquery::Reservation::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_reservation_groups.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_reservation_groups.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.call_rpc :list_reservation_groups, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @reservation_service_stub, :list_reservation_groups, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the ReservationService API. - # - # This class represents the configuration for ReservationService, - # 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::Bigquery::Reservation::V1::ReservationService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_reservation to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_reservation.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_reservation.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "bigqueryreservation.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the ReservationService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_reservation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_reservation - ## - # RPC-specific configuration for `list_reservations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_reservations - ## - # RPC-specific configuration for `get_reservation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_reservation - ## - # RPC-specific configuration for `delete_reservation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_reservation - ## - # RPC-specific configuration for `update_reservation` - # @return [::Gapic::Config::Method] - # - attr_reader :update_reservation - ## - # RPC-specific configuration for `failover_reservation` - # @return [::Gapic::Config::Method] - # - attr_reader :failover_reservation - ## - # RPC-specific configuration for `create_capacity_commitment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_capacity_commitment - ## - # RPC-specific configuration for `list_capacity_commitments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_capacity_commitments - ## - # RPC-specific configuration for `get_capacity_commitment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_capacity_commitment - ## - # RPC-specific configuration for `delete_capacity_commitment` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_capacity_commitment - ## - # RPC-specific configuration for `update_capacity_commitment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_capacity_commitment - ## - # RPC-specific configuration for `split_capacity_commitment` - # @return [::Gapic::Config::Method] - # - attr_reader :split_capacity_commitment - ## - # RPC-specific configuration for `merge_capacity_commitments` - # @return [::Gapic::Config::Method] - # - attr_reader :merge_capacity_commitments - ## - # RPC-specific configuration for `create_assignment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_assignment - ## - # RPC-specific configuration for `list_assignments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_assignments - ## - # RPC-specific configuration for `delete_assignment` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_assignment - ## - # RPC-specific configuration for `search_assignments` - # @return [::Gapic::Config::Method] - # - attr_reader :search_assignments - ## - # RPC-specific configuration for `search_all_assignments` - # @return [::Gapic::Config::Method] - # - attr_reader :search_all_assignments - ## - # RPC-specific configuration for `move_assignment` - # @return [::Gapic::Config::Method] - # - attr_reader :move_assignment - ## - # RPC-specific configuration for `update_assignment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_assignment - ## - # RPC-specific configuration for `get_bi_reservation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_bi_reservation - ## - # RPC-specific configuration for `update_bi_reservation` - # @return [::Gapic::Config::Method] - # - attr_reader :update_bi_reservation - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `create_reservation_group` - # @return [::Gapic::Config::Method] - # - attr_reader :create_reservation_group - ## - # RPC-specific configuration for `get_reservation_group` - # @return [::Gapic::Config::Method] - # - attr_reader :get_reservation_group - ## - # RPC-specific configuration for `delete_reservation_group` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_reservation_group - ## - # RPC-specific configuration for `list_reservation_groups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_reservation_groups - - # @private - def initialize parent_rpcs = nil - create_reservation_config = parent_rpcs.create_reservation if parent_rpcs.respond_to? :create_reservation - @create_reservation = ::Gapic::Config::Method.new create_reservation_config - list_reservations_config = parent_rpcs.list_reservations if parent_rpcs.respond_to? :list_reservations - @list_reservations = ::Gapic::Config::Method.new list_reservations_config - get_reservation_config = parent_rpcs.get_reservation if parent_rpcs.respond_to? :get_reservation - @get_reservation = ::Gapic::Config::Method.new get_reservation_config - delete_reservation_config = parent_rpcs.delete_reservation if parent_rpcs.respond_to? :delete_reservation - @delete_reservation = ::Gapic::Config::Method.new delete_reservation_config - update_reservation_config = parent_rpcs.update_reservation if parent_rpcs.respond_to? :update_reservation - @update_reservation = ::Gapic::Config::Method.new update_reservation_config - failover_reservation_config = parent_rpcs.failover_reservation if parent_rpcs.respond_to? :failover_reservation - @failover_reservation = ::Gapic::Config::Method.new failover_reservation_config - create_capacity_commitment_config = parent_rpcs.create_capacity_commitment if parent_rpcs.respond_to? :create_capacity_commitment - @create_capacity_commitment = ::Gapic::Config::Method.new create_capacity_commitment_config - list_capacity_commitments_config = parent_rpcs.list_capacity_commitments if parent_rpcs.respond_to? :list_capacity_commitments - @list_capacity_commitments = ::Gapic::Config::Method.new list_capacity_commitments_config - get_capacity_commitment_config = parent_rpcs.get_capacity_commitment if parent_rpcs.respond_to? :get_capacity_commitment - @get_capacity_commitment = ::Gapic::Config::Method.new get_capacity_commitment_config - delete_capacity_commitment_config = parent_rpcs.delete_capacity_commitment if parent_rpcs.respond_to? :delete_capacity_commitment - @delete_capacity_commitment = ::Gapic::Config::Method.new delete_capacity_commitment_config - update_capacity_commitment_config = parent_rpcs.update_capacity_commitment if parent_rpcs.respond_to? :update_capacity_commitment - @update_capacity_commitment = ::Gapic::Config::Method.new update_capacity_commitment_config - split_capacity_commitment_config = parent_rpcs.split_capacity_commitment if parent_rpcs.respond_to? :split_capacity_commitment - @split_capacity_commitment = ::Gapic::Config::Method.new split_capacity_commitment_config - merge_capacity_commitments_config = parent_rpcs.merge_capacity_commitments if parent_rpcs.respond_to? :merge_capacity_commitments - @merge_capacity_commitments = ::Gapic::Config::Method.new merge_capacity_commitments_config - create_assignment_config = parent_rpcs.create_assignment if parent_rpcs.respond_to? :create_assignment - @create_assignment = ::Gapic::Config::Method.new create_assignment_config - list_assignments_config = parent_rpcs.list_assignments if parent_rpcs.respond_to? :list_assignments - @list_assignments = ::Gapic::Config::Method.new list_assignments_config - delete_assignment_config = parent_rpcs.delete_assignment if parent_rpcs.respond_to? :delete_assignment - @delete_assignment = ::Gapic::Config::Method.new delete_assignment_config - search_assignments_config = parent_rpcs.search_assignments if parent_rpcs.respond_to? :search_assignments - @search_assignments = ::Gapic::Config::Method.new search_assignments_config - search_all_assignments_config = parent_rpcs.search_all_assignments if parent_rpcs.respond_to? :search_all_assignments - @search_all_assignments = ::Gapic::Config::Method.new search_all_assignments_config - move_assignment_config = parent_rpcs.move_assignment if parent_rpcs.respond_to? :move_assignment - @move_assignment = ::Gapic::Config::Method.new move_assignment_config - update_assignment_config = parent_rpcs.update_assignment if parent_rpcs.respond_to? :update_assignment - @update_assignment = ::Gapic::Config::Method.new update_assignment_config - get_bi_reservation_config = parent_rpcs.get_bi_reservation if parent_rpcs.respond_to? :get_bi_reservation - @get_bi_reservation = ::Gapic::Config::Method.new get_bi_reservation_config - update_bi_reservation_config = parent_rpcs.update_bi_reservation if parent_rpcs.respond_to? :update_bi_reservation - @update_bi_reservation = ::Gapic::Config::Method.new update_bi_reservation_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - create_reservation_group_config = parent_rpcs.create_reservation_group if parent_rpcs.respond_to? :create_reservation_group - @create_reservation_group = ::Gapic::Config::Method.new create_reservation_group_config - get_reservation_group_config = parent_rpcs.get_reservation_group if parent_rpcs.respond_to? :get_reservation_group - @get_reservation_group = ::Gapic::Config::Method.new get_reservation_group_config - delete_reservation_group_config = parent_rpcs.delete_reservation_group if parent_rpcs.respond_to? :delete_reservation_group - @delete_reservation_group = ::Gapic::Config::Method.new delete_reservation_group_config - list_reservation_groups_config = parent_rpcs.list_reservation_groups if parent_rpcs.respond_to? :list_reservation_groups - @list_reservation_groups = ::Gapic::Config::Method.new list_reservation_groups_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/credentials.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/credentials.rb deleted file mode 100644 index a5d4a895f5bb..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/credentials.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Bigquery - module Reservation - module V1 - module ReservationService - # Credentials for the ReservationService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/bigquery", - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "BIGQUERY_RESERVATION_CREDENTIALS", - "BIGQUERY_RESERVATION_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "BIGQUERY_RESERVATION_CREDENTIALS_JSON", - "BIGQUERY_RESERVATION_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/paths.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/paths.rb deleted file mode 100644 index 3b899d027983..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/paths.rb +++ /dev/null @@ -1,147 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Bigquery - module Reservation - module V1 - module ReservationService - # Path helper methods for the ReservationService API. - module Paths - ## - # Create a fully-qualified Assignment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}` - # - # @param project [String] - # @param location [String] - # @param reservation [String] - # @param assignment [String] - # - # @return [::String] - def assignment_path project:, location:, reservation:, assignment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "reservation cannot contain /" if reservation.to_s.include? "/" - - "projects/#{project}/locations/#{location}/reservations/#{reservation}/assignments/#{assignment}" - end - - ## - # Create a fully-qualified BiReservation resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/biReservation` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def bi_reservation_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/biReservation" - end - - ## - # Create a fully-qualified CapacityCommitment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}` - # - # @param project [String] - # @param location [String] - # @param capacity_commitment [String] - # - # @return [::String] - def capacity_commitment_path project:, location:, capacity_commitment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/capacityCommitments/#{capacity_commitment}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Reservation resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/reservations/{reservation}` - # - # @param project [String] - # @param location [String] - # @param reservation [String] - # - # @return [::String] - def reservation_path project:, location:, reservation: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/reservations/#{reservation}" - end - - ## - # Create a fully-qualified ReservationGroup resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/reservationGroups/{reservation_group}` - # - # @param project [String] - # @param location [String] - # @param reservation_group [String] - # - # @return [::String] - def reservation_group_path project:, location:, reservation_group: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/reservationGroups/#{reservation_group}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest.rb deleted file mode 100644 index a91126179e23..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest.rb +++ /dev/null @@ -1,68 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/bigquery/reservation/v1/version" - -require "google/cloud/bigquery/reservation/v1/reservation_service/credentials" -require "google/cloud/bigquery/reservation/v1/reservation_service/paths" -require "google/cloud/bigquery/reservation/v1/reservation_service/rest/client" - -module Google - module Cloud - module Bigquery - module Reservation - module V1 - ## - # This API allows users to manage their BigQuery reservations. - # - # A reservation provides computational resource guarantees, in the form of - # [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a - # unit of computational power in BigQuery, and serves as the basic unit of - # parallelism. In a scan of a multi-partitioned table, a single slot operates - # on a single partition of the table. A reservation resource exists as a child - # resource of the admin project and location, e.g.: - # `projects/myproject/locations/US/reservations/reservationName`. - # - # A capacity commitment is a way to purchase compute capacity for BigQuery jobs - # (in the form of slots) with some committed period of usage. A capacity - # commitment resource exists as a child resource of the admin project and - # location, e.g.: - # `projects/myproject/locations/US/capacityCommitments/id`. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/bigquery/reservation/v1/reservation_service/rest" - # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - module ReservationService - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/bigquery/reservation/v1/reservation_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb deleted file mode 100644 index 89cf0fa7cae2..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/client.rb +++ /dev/null @@ -1,3266 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/bigquery/reservation/v1/reservation_pb" -require "google/cloud/bigquery/reservation/v1/reservation_service/rest/service_stub" - -module Google - module Cloud - module Bigquery - module Reservation - module V1 - module ReservationService - module Rest - ## - # REST client for the ReservationService service. - # - # This API allows users to manage their BigQuery reservations. - # - # A reservation provides computational resource guarantees, in the form of - # [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a - # unit of computational power in BigQuery, and serves as the basic unit of - # parallelism. In a scan of a multi-partitioned table, a single slot operates - # on a single partition of the table. A reservation resource exists as a child - # resource of the admin project and location, e.g.: - # `projects/myproject/locations/US/reservations/reservationName`. - # - # A capacity commitment is a way to purchase compute capacity for BigQuery jobs - # (in the form of slots) with some committed period of usage. A capacity - # commitment resource exists as a child resource of the admin project and - # location, e.g.: - # `projects/myproject/locations/US/capacityCommitments/id`. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "bigqueryreservation.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :reservation_service_stub - - ## - # Configure the ReservationService Client class. - # - # See {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ReservationService clients - # ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::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", "Bigquery", "Reservation", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_reservation.timeout = 300.0 - - default_config.rpcs.list_reservations.timeout = 300.0 - default_config.rpcs.list_reservations.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_reservation.timeout = 300.0 - default_config.rpcs.get_reservation.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.delete_reservation.timeout = 300.0 - default_config.rpcs.delete_reservation.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_reservation.timeout = 300.0 - - default_config.rpcs.failover_reservation.timeout = 300.0 - - default_config.rpcs.create_capacity_commitment.timeout = 300.0 - - default_config.rpcs.list_capacity_commitments.timeout = 300.0 - default_config.rpcs.list_capacity_commitments.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_capacity_commitment.timeout = 300.0 - default_config.rpcs.get_capacity_commitment.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.delete_capacity_commitment.timeout = 300.0 - default_config.rpcs.delete_capacity_commitment.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_capacity_commitment.timeout = 300.0 - - default_config.rpcs.split_capacity_commitment.timeout = 300.0 - - default_config.rpcs.merge_capacity_commitments.timeout = 300.0 - - default_config.rpcs.create_assignment.timeout = 300.0 - - default_config.rpcs.list_assignments.timeout = 300.0 - default_config.rpcs.list_assignments.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.delete_assignment.timeout = 300.0 - default_config.rpcs.delete_assignment.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_assignments.timeout = 300.0 - default_config.rpcs.search_assignments.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.move_assignment.timeout = 300.0 - - default_config.rpcs.get_bi_reservation.timeout = 300.0 - default_config.rpcs.get_bi_reservation.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_bi_reservation.timeout = 300.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ReservationService 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::Bigquery::Reservation::V1::ReservationService::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 - @reservation_service_stub.universe_domain - end - - ## - # Create a new ReservationService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ReservationService 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 - - @reservation_service_stub = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @reservation_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @reservation_service_stub.logger - end - - # Service calls - - ## - # Creates a new reservation resource. - # - # @overload create_reservation(request, options = nil) - # Pass arguments to `create_reservation` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_reservation(parent: nil, reservation_id: nil, reservation: nil) - # Pass arguments to `create_reservation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Project, location. E.g., - # `projects/myproject/locations/US` - # @param reservation_id [::String] - # The reservation ID. It must only contain lower case alphanumeric - # characters or dashes. It must start with a letter and must not end - # with a dash. Its maximum length is 64 characters. - # @param reservation [::Google::Cloud::Bigquery::Reservation::V1::Reservation, ::Hash] - # Definition of the new reservation to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new - # - # # Call the create_reservation method. - # result = client.create_reservation request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. - # p result - # - def create_reservation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_reservation.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_reservation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_reservation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.create_reservation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the reservations for the project in the specified location. - # - # @overload list_reservations(request, options = nil) - # Pass arguments to `list_reservations` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_reservations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_reservations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name containing project and location, e.g.: - # `projects/myproject/locations/US` - # @param page_size [::Integer] - # The maximum number of items to return per page. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Reservation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Reservation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new - # - # # Call the list_reservations method. - # result = client.list_reservations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Reservation. - # p item - # end - # - def list_reservations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_reservations.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_reservations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_reservations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.list_reservations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :list_reservations, "reservations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns information about the reservation. - # - # @overload get_reservation(request, options = nil) - # Pass arguments to `get_reservation` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_reservation(name: nil) - # Pass arguments to `get_reservation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the reservation to retrieve. E.g., - # `projects/myproject/locations/US/reservations/team1-prod` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new - # - # # Call the get_reservation method. - # result = client.get_reservation request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. - # p result - # - def get_reservation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_reservation.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_reservation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_reservation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.get_reservation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a reservation. - # Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has - # assignments. - # - # @overload delete_reservation(request, options = nil) - # Pass arguments to `delete_reservation` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_reservation(name: nil) - # Pass arguments to `delete_reservation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the reservation to retrieve. E.g., - # `projects/myproject/locations/US/reservations/team1-prod` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new - # - # # Call the delete_reservation method. - # result = client.delete_reservation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_reservation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_reservation.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_reservation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_reservation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.delete_reservation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an existing reservation resource. - # - # @overload update_reservation(request, options = nil) - # Pass arguments to `update_reservation` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_reservation(reservation: nil, update_mask: nil) - # Pass arguments to `update_reservation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param reservation [::Google::Cloud::Bigquery::Reservation::V1::Reservation, ::Hash] - # Content of the reservation to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Standard field mask for the set of fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new - # - # # Call the update_reservation method. - # result = client.update_reservation request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. - # p result - # - def update_reservation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_reservation.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_reservation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_reservation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.update_reservation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Fail over a reservation to the secondary location. The operation should be - # done in the current secondary location, which will be promoted to the - # new primary location for the reservation. - # Attempting to failover a reservation in the current primary location will - # fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. - # - # @overload failover_reservation(request, options = nil) - # Pass arguments to `failover_reservation` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload failover_reservation(name: nil, failover_mode: nil) - # Pass arguments to `failover_reservation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the reservation to failover. E.g., - # `projects/myproject/locations/US/reservations/team1-prod` - # @param failover_mode [::Google::Cloud::Bigquery::Reservation::V1::FailoverMode] - # Optional. A parameter that determines how writes that are pending - # replication are handled after a failover is initiated. If not specified, - # HARD failover mode is used by default. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest.new - # - # # Call the failover_reservation method. - # result = client.failover_reservation request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. - # p result - # - def failover_reservation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest - - # Converts hash 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.failover_reservation.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::Bigquery::Reservation::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.failover_reservation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.failover_reservation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.failover_reservation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new capacity commitment resource. - # - # @overload create_capacity_commitment(request, options = nil) - # Pass arguments to `create_capacity_commitment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_capacity_commitment(parent: nil, capacity_commitment: nil, enforce_single_admin_project_per_org: nil, capacity_commitment_id: nil) - # Pass arguments to `create_capacity_commitment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the parent reservation. E.g., - # `projects/myproject/locations/US` - # @param capacity_commitment [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment, ::Hash] - # Content of the capacity commitment to create. - # @param enforce_single_admin_project_per_org [::Boolean] - # If true, fail the request if another project in the organization has a - # capacity commitment. - # @param capacity_commitment_id [::String] - # The optional capacity commitment ID. Capacity commitment name will be - # generated automatically if this field is empty. - # This field must only contain lower case alphanumeric characters or dashes. - # The first and last character cannot be a dash. Max length is 64 characters. - # NOTE: this ID won't be kept if the capacity commitment is split or merged. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new - # - # # Call the create_capacity_commitment method. - # result = client.create_capacity_commitment request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - # p result - # - def create_capacity_commitment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_capacity_commitment.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_capacity_commitment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_capacity_commitment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.create_capacity_commitment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the capacity commitments for the admin project. - # - # @overload list_capacity_commitments(request, options = nil) - # Pass arguments to `list_capacity_commitments` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_capacity_commitments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_capacity_commitments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Resource name of the parent reservation. E.g., - # `projects/myproject/locations/US` - # @param page_size [::Integer] - # The maximum number of items to return. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new - # - # # Call the list_capacity_commitments method. - # result = client.list_capacity_commitments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - # p item - # end - # - def list_capacity_commitments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_capacity_commitments.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_capacity_commitments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_capacity_commitments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.list_capacity_commitments request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :list_capacity_commitments, "capacity_commitments", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns information about the capacity commitment. - # - # @overload get_capacity_commitment(request, options = nil) - # Pass arguments to `get_capacity_commitment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_capacity_commitment(name: nil) - # Pass arguments to `get_capacity_commitment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the capacity commitment to retrieve. E.g., - # `projects/myproject/locations/US/capacityCommitments/123` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new - # - # # Call the get_capacity_commitment method. - # result = client.get_capacity_commitment request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - # p result - # - def get_capacity_commitment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_capacity_commitment.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_capacity_commitment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_capacity_commitment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.get_capacity_commitment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a capacity commitment. Attempting to delete capacity commitment - # before its commitment_end_time will fail with the error code - # `google.rpc.Code.FAILED_PRECONDITION`. - # - # @overload delete_capacity_commitment(request, options = nil) - # Pass arguments to `delete_capacity_commitment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_capacity_commitment(name: nil, force: nil) - # Pass arguments to `delete_capacity_commitment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the capacity commitment to delete. E.g., - # `projects/myproject/locations/US/capacityCommitments/123` - # @param force [::Boolean] - # Can be used to force delete commitments even if assignments exist. Deleting - # commitments with assignments may cause queries to fail if they no longer - # have access to slots. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new - # - # # Call the delete_capacity_commitment method. - # result = client.delete_capacity_commitment request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_capacity_commitment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_capacity_commitment.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_capacity_commitment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_capacity_commitment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.delete_capacity_commitment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an existing capacity commitment. - # - # Only `plan` and `renewal_plan` fields can be updated. - # - # Plan can only be changed to a plan of a longer commitment period. - # Attempting to change to a plan with shorter commitment period will fail - # with the error code `google.rpc.Code.FAILED_PRECONDITION`. - # - # @overload update_capacity_commitment(request, options = nil) - # Pass arguments to `update_capacity_commitment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_capacity_commitment(capacity_commitment: nil, update_mask: nil) - # Pass arguments to `update_capacity_commitment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param capacity_commitment [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment, ::Hash] - # Content of the capacity commitment to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Standard field mask for the set of fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new - # - # # Call the update_capacity_commitment method. - # result = client.update_capacity_commitment request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - # p result - # - def update_capacity_commitment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_capacity_commitment.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_capacity_commitment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_capacity_commitment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.update_capacity_commitment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Splits capacity commitment to two commitments of the same plan and - # `commitment_end_time`. - # - # A common use case is to enable downgrading commitments. - # - # For example, in order to downgrade from 10000 slots to 8000, you might - # split a 10000 capacity commitment into commitments of 2000 and 8000. Then, - # you delete the first one after the commitment end time passes. - # - # @overload split_capacity_commitment(request, options = nil) - # Pass arguments to `split_capacity_commitment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload split_capacity_commitment(name: nil, slot_count: nil) - # Pass arguments to `split_capacity_commitment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name e.g.,: - # `projects/myproject/locations/US/capacityCommitments/123` - # @param slot_count [::Integer] - # Number of slots in the capacity commitment after the split. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new - # - # # Call the split_capacity_commitment method. - # result = client.split_capacity_commitment request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse. - # p result - # - def split_capacity_commitment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest - - # Converts hash 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.split_capacity_commitment.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::Bigquery::Reservation::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.split_capacity_commitment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.split_capacity_commitment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.split_capacity_commitment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Merges capacity commitments of the same plan into a single commitment. - # - # The resulting capacity commitment has the greater commitment_end_time - # out of the to-be-merged capacity commitments. - # - # Attempting to merge capacity commitments of different plan will fail - # with the error code `google.rpc.Code.FAILED_PRECONDITION`. - # - # @overload merge_capacity_commitments(request, options = nil) - # Pass arguments to `merge_capacity_commitments` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload merge_capacity_commitments(parent: nil, capacity_commitment_ids: nil, capacity_commitment_id: nil) - # Pass arguments to `merge_capacity_commitments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Parent resource that identifies admin project and location e.g., - # `projects/myproject/locations/us` - # @param capacity_commitment_ids [::Array<::String>] - # Ids of capacity commitments to merge. - # These capacity commitments must exist under admin project and location - # specified in the parent. - # ID is the last portion of capacity commitment name e.g., 'abc' for - # projects/myproject/locations/US/capacityCommitments/abc - # @param capacity_commitment_id [::String] - # Optional. The optional resulting capacity commitment ID. Capacity - # commitment name will be generated automatically if this field is empty. - # This field must only contain lower case alphanumeric characters or dashes. - # The first and last character cannot be a dash. Max length is 64 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new - # - # # Call the merge_capacity_commitments method. - # result = client.merge_capacity_commitments request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - # p result - # - def merge_capacity_commitments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest - - # Converts hash 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.merge_capacity_commitments.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::Bigquery::Reservation::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.merge_capacity_commitments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.merge_capacity_commitments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.merge_capacity_commitments request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an assignment object which allows the given project to submit jobs - # of a certain type using slots from the specified reservation. - # - # Currently a - # resource (project, folder, organization) can only have one assignment per - # each (job_type, location) combination, and that reservation will be used - # for all jobs of the matching type. - # - # Different assignments can be created on different levels of the - # projects, folders or organization hierarchy. During query execution, - # the assignment is looked up at the project, folder and organization levels - # in that order. The first assignment found is applied to the query. - # - # When creating assignments, it does not matter if other assignments exist at - # higher levels. - # - # Example: - # - # * The organization `organizationA` contains two projects, `project1` - # and `project2`. - # * Assignments for all three entities (`organizationA`, `project1`, and - # `project2`) could all be created and mapped to the same or different - # reservations. - # - # "None" assignments represent an absence of the assignment. Projects - # assigned to None use on-demand pricing. To create a "None" assignment, use - # "none" as a reservation_id in the parent. Example parent: - # `projects/myproject/locations/US/reservations/none`. - # - # Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have - # 'bigquery.admin' permissions on the project using the reservation - # and the project that owns this reservation. - # - # Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment - # does not match location of the reservation. - # - # @overload create_assignment(request, options = nil) - # Pass arguments to `create_assignment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_assignment(parent: nil, assignment: nil, assignment_id: nil) - # Pass arguments to `create_assignment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name of the assignment - # E.g. `projects/myproject/locations/US/reservations/team1-prod` - # @param assignment [::Google::Cloud::Bigquery::Reservation::V1::Assignment, ::Hash] - # Assignment resource to create. - # @param assignment_id [::String] - # The optional assignment ID. Assignment name will be generated automatically - # if this field is empty. - # This field must only contain lower case alphanumeric characters or dashes. - # Max length is 64 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new - # - # # Call the create_assignment method. - # result = client.create_assignment request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. - # p result - # - def create_assignment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_assignment.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_assignment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_assignment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.create_assignment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists assignments. - # - # Only explicitly created assignments will be returned. - # - # Example: - # - # * Organization `organizationA` contains two projects, `project1` and - # `project2`. - # * Reservation `res1` exists and was created previously. - # * CreateAssignment was used previously to define the following - # associations between entities and reservations: `` - # and `` - # - # In this example, ListAssignments will just return the above two assignments - # for reservation `res1`, and no expansion/merge will happen. - # - # The wildcard "-" can be used for - # reservations in the request. In that case all assignments belongs to the - # specified project and location will be listed. - # - # **Note** "-" cannot be used for projects nor locations. - # - # @overload list_assignments(request, options = nil) - # Pass arguments to `list_assignments` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_assignments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_assignments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name e.g.: - # - # `projects/myproject/locations/US/reservations/team1-prod` - # - # Or: - # - # `projects/myproject/locations/US/reservations/-` - # @param page_size [::Integer] - # The maximum number of items to return per page. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new - # - # # Call the list_assignments method. - # result = client.list_assignments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. - # p item - # end - # - def list_assignments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_assignments.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_assignments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_assignments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.list_assignments request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :list_assignments, "assignments", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a assignment. No expansion will happen. - # - # Example: - # - # * Organization `organizationA` contains two projects, `project1` and - # `project2`. - # * Reservation `res1` exists and was created previously. - # * CreateAssignment was used previously to define the following - # associations between entities and reservations: `` - # and `` - # - # In this example, deletion of the `` assignment won't - # affect the other assignment ``. After said deletion, - # queries from `project1` will still use `res1` while queries from - # `project2` will switch to use on-demand mode. - # - # @overload delete_assignment(request, options = nil) - # Pass arguments to `delete_assignment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_assignment(name: nil) - # Pass arguments to `delete_assignment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the resource, e.g. - # `projects/myproject/locations/US/reservations/team1-prod/assignments/123` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new - # - # # Call the delete_assignment method. - # result = client.delete_assignment request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_assignment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_assignment.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_assignment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_assignment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.delete_assignment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deprecated: Looks up assignments for a specified resource for a particular - # region. If the request is about a project: - # - # 1. Assignments created on the project will be returned if they exist. - # 2. Otherwise assignments created on the closest ancestor will be - # returned. - # 3. Assignments for different JobTypes will all be returned. - # - # The same logic applies if the request is about a folder. - # - # If the request is about an organization, then assignments created on the - # organization will be returned (organization doesn't have ancestors). - # - # Comparing to ListAssignments, there are some behavior - # differences: - # - # 1. permission on the assignee will be verified in this API. - # 2. Hierarchy lookup (project->folder->organization) happens in this API. - # 3. Parent here is `projects/*/locations/*`, instead of - # `projects/*/locations/*reservations/*`. - # - # **Note** "-" cannot be used for projects - # nor locations. - # - # @overload search_assignments(request, options = nil) - # Pass arguments to `search_assignments` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search_assignments(parent: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_assignments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the admin project(containing project and - # location), e.g.: - # `projects/myproject/locations/US`. - # @param query [::String] - # Please specify resource name as assignee in the query. - # - # Examples: - # - # * `assignee=projects/myproject` - # * `assignee=folders/123` - # * `assignee=organizations/456` - # @param page_size [::Integer] - # The maximum number of items to return per page. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new - # - # # Call the search_assignments method. - # result = client.search_assignments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. - # p item - # end - # - def search_assignments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest - - # Converts hash 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.search_assignments.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::Bigquery::Reservation::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.search_assignments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_assignments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.search_assignments request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :search_assignments, "assignments", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Looks up assignments for a specified resource for a particular region. - # If the request is about a project: - # - # 1. Assignments created on the project will be returned if they exist. - # 2. Otherwise assignments created on the closest ancestor will be - # returned. - # 3. Assignments for different JobTypes will all be returned. - # - # The same logic applies if the request is about a folder. - # - # If the request is about an organization, then assignments created on the - # organization will be returned (organization doesn't have ancestors). - # - # Comparing to ListAssignments, there are some behavior - # differences: - # - # 1. permission on the assignee will be verified in this API. - # 2. Hierarchy lookup (project->folder->organization) happens in this API. - # 3. Parent here is `projects/*/locations/*`, instead of - # `projects/*/locations/*reservations/*`. - # - # @overload search_all_assignments(request, options = nil) - # Pass arguments to `search_all_assignments` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search_all_assignments(parent: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_all_assignments` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name with location (project name could be the - # wildcard '-'), e.g.: - # `projects/-/locations/US`. - # @param query [::String] - # Please specify resource name as assignee in the query. - # - # Examples: - # - # * `assignee=projects/myproject` - # * `assignee=folders/123` - # * `assignee=organizations/456` - # @param page_size [::Integer] - # The maximum number of items to return per page. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new - # - # # Call the search_all_assignments method. - # result = client.search_all_assignments request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. - # p item - # end - # - def search_all_assignments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest - - # Converts hash 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.search_all_assignments.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::Bigquery::Reservation::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.search_all_assignments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_all_assignments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.search_all_assignments request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :search_all_assignments, "assignments", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Moves an assignment under a new reservation. - # - # This differs from removing an existing assignment and recreating a new one - # by providing a transactional change that ensures an assignee always has an - # associated reservation. - # - # @overload move_assignment(request, options = nil) - # Pass arguments to `move_assignment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload move_assignment(name: nil, destination_id: nil, assignment_id: nil) - # Pass arguments to `move_assignment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the assignment, - # e.g. - # `projects/myproject/locations/US/reservations/team1-prod/assignments/123` - # @param destination_id [::String] - # The new reservation ID, e.g.: - # `projects/myotherproject/locations/US/reservations/team2-prod` - # @param assignment_id [::String] - # The optional assignment ID. A new assignment name is generated if this - # field is empty. - # - # This field can contain only lowercase alphanumeric characters or dashes. - # Max length is 64 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new - # - # # Call the move_assignment method. - # result = client.move_assignment request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. - # p result - # - def move_assignment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.move_assignment.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.move_assignment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.move_assignment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.move_assignment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an existing assignment. - # - # Only the `priority` field can be updated. - # - # @overload update_assignment(request, options = nil) - # Pass arguments to `update_assignment` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_assignment(assignment: nil, update_mask: nil) - # Pass arguments to `update_assignment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param assignment [::Google::Cloud::Bigquery::Reservation::V1::Assignment, ::Hash] - # Content of the assignment to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Standard field mask for the set of fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new - # - # # Call the update_assignment method. - # result = client.update_assignment request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. - # p result - # - def update_assignment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_assignment.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_assignment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_assignment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.update_assignment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a BI reservation. - # - # @overload get_bi_reservation(request, options = nil) - # Pass arguments to `get_bi_reservation` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_bi_reservation(name: nil) - # Pass arguments to `get_bi_reservation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the requested reservation, for example: - # `projects/{project_id}/locations/{location_id}/biReservation` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new - # - # # Call the get_bi_reservation method. - # result = client.get_bi_reservation request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. - # p result - # - def get_bi_reservation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_bi_reservation.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_bi_reservation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_bi_reservation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.get_bi_reservation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a BI reservation. - # - # Only fields specified in the `field_mask` are updated. - # - # A singleton BI reservation always exists with default size 0. - # In order to reserve BI capacity it needs to be updated to an amount - # greater than 0. In order to release BI capacity reservation size - # must be set to 0. - # - # @overload update_bi_reservation(request, options = nil) - # Pass arguments to `update_bi_reservation` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_bi_reservation(bi_reservation: nil, update_mask: nil) - # Pass arguments to `update_bi_reservation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param bi_reservation [::Google::Cloud::Bigquery::Reservation::V1::BiReservation, ::Hash] - # A reservation to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A list of fields to be updated in this request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new - # - # # Call the update_bi_reservation method. - # result = client.update_bi_reservation request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. - # p result - # - def update_bi_reservation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_bi_reservation.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_bi_reservation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_bi_reservation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.update_bi_reservation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a resource. - # May return: - # - # * A`NOT_FOUND` error if the resource doesn't exist or you don't have the - # permission to view it. - # * An empty policy if the resource exists but doesn't have a set policy. - # - # Supported resources are: - # - Reservations - # - ReservationAssignments - # - # To call this method, you must have the following Google IAM permissions: - # - # - `bigqueryreservation.reservations.getIamPolicy` to get policies on - # reservations. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets an access control policy for a resource. Replaces any existing - # policy. - # - # Supported resources are: - # - Reservations - # - # To call this method, you must have the following Google IAM permissions: - # - # - `bigqueryreservation.reservations.setIamPolicy` to set policies on - # reservations. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets your permissions on a resource. Returns an empty set of permissions if - # the resource doesn't exist. - # - # Supported resources are: - # - Reservations - # - # No Google IAM permissions are required to call this method. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new reservation group. - # - # @overload create_reservation_group(request, options = nil) - # Pass arguments to `create_reservation_group` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_reservation_group(parent: nil, reservation_group_id: nil, reservation_group: nil) - # Pass arguments to `create_reservation_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Project, location. E.g., - # `projects/myproject/locations/US` - # @param reservation_group_id [::String] - # Required. The reservation group ID. It must only contain lower case - # alphanumeric characters or dashes. It must start with a letter and must not - # end with a dash. Its maximum length is 64 characters. - # @param reservation_group [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup, ::Hash] - # Required. New Reservation Group to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest.new - # - # # Call the create_reservation_group method. - # result = client.create_reservation_group request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. - # p result - # - def create_reservation_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_reservation_group.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_reservation_group.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_reservation_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.create_reservation_group request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns information about the reservation group. - # - # @overload get_reservation_group(request, options = nil) - # Pass arguments to `get_reservation_group` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_reservation_group(name: nil) - # Pass arguments to `get_reservation_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the reservation group to retrieve. E.g., - # `projects/myproject/locations/US/reservationGroups/team1-prod` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest.new - # - # # Call the get_reservation_group method. - # result = client.get_reservation_group request - # - # # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. - # p result - # - def get_reservation_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_reservation_group.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_reservation_group.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_reservation_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.get_reservation_group request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a reservation. - # Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has - # assignments. - # - # @overload delete_reservation_group(request, options = nil) - # Pass arguments to `delete_reservation_group` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_reservation_group(name: nil) - # Pass arguments to `delete_reservation_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of the reservation group to retrieve. E.g., - # `projects/myproject/locations/US/reservationGroups/team1-prod` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest.new - # - # # Call the delete_reservation_group method. - # result = client.delete_reservation_group request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_reservation_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_reservation_group.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_reservation_group.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_reservation_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.delete_reservation_group request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the reservation groups for the project in the specified location. - # - # @overload list_reservation_groups(request, options = nil) - # Pass arguments to `list_reservation_groups` via a request object, either of type - # {::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_reservation_groups(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_reservation_groups` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name containing project and location, e.g.: - # `projects/myproject/locations/US` - # @param page_size [::Integer] - # The maximum number of items to return per page. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/bigquery/reservation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest.new - # - # # Call the list_reservation_groups method. - # result = client.list_reservation_groups request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. - # p item - # end - # - def list_reservation_groups request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_reservation_groups.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::Bigquery::Reservation::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_reservation_groups.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_reservation_groups.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @reservation_service_stub.list_reservation_groups request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @reservation_service_stub, :list_reservation_groups, "reservation_groups", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the ReservationService REST API. - # - # This class represents the configuration for ReservationService 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::Bigquery::Reservation::V1::ReservationService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_reservation to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_reservation.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_reservation.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "bigqueryreservation.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the ReservationService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_reservation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_reservation - ## - # RPC-specific configuration for `list_reservations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_reservations - ## - # RPC-specific configuration for `get_reservation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_reservation - ## - # RPC-specific configuration for `delete_reservation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_reservation - ## - # RPC-specific configuration for `update_reservation` - # @return [::Gapic::Config::Method] - # - attr_reader :update_reservation - ## - # RPC-specific configuration for `failover_reservation` - # @return [::Gapic::Config::Method] - # - attr_reader :failover_reservation - ## - # RPC-specific configuration for `create_capacity_commitment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_capacity_commitment - ## - # RPC-specific configuration for `list_capacity_commitments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_capacity_commitments - ## - # RPC-specific configuration for `get_capacity_commitment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_capacity_commitment - ## - # RPC-specific configuration for `delete_capacity_commitment` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_capacity_commitment - ## - # RPC-specific configuration for `update_capacity_commitment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_capacity_commitment - ## - # RPC-specific configuration for `split_capacity_commitment` - # @return [::Gapic::Config::Method] - # - attr_reader :split_capacity_commitment - ## - # RPC-specific configuration for `merge_capacity_commitments` - # @return [::Gapic::Config::Method] - # - attr_reader :merge_capacity_commitments - ## - # RPC-specific configuration for `create_assignment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_assignment - ## - # RPC-specific configuration for `list_assignments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_assignments - ## - # RPC-specific configuration for `delete_assignment` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_assignment - ## - # RPC-specific configuration for `search_assignments` - # @return [::Gapic::Config::Method] - # - attr_reader :search_assignments - ## - # RPC-specific configuration for `search_all_assignments` - # @return [::Gapic::Config::Method] - # - attr_reader :search_all_assignments - ## - # RPC-specific configuration for `move_assignment` - # @return [::Gapic::Config::Method] - # - attr_reader :move_assignment - ## - # RPC-specific configuration for `update_assignment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_assignment - ## - # RPC-specific configuration for `get_bi_reservation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_bi_reservation - ## - # RPC-specific configuration for `update_bi_reservation` - # @return [::Gapic::Config::Method] - # - attr_reader :update_bi_reservation - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `create_reservation_group` - # @return [::Gapic::Config::Method] - # - attr_reader :create_reservation_group - ## - # RPC-specific configuration for `get_reservation_group` - # @return [::Gapic::Config::Method] - # - attr_reader :get_reservation_group - ## - # RPC-specific configuration for `delete_reservation_group` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_reservation_group - ## - # RPC-specific configuration for `list_reservation_groups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_reservation_groups - - # @private - def initialize parent_rpcs = nil - create_reservation_config = parent_rpcs.create_reservation if parent_rpcs.respond_to? :create_reservation - @create_reservation = ::Gapic::Config::Method.new create_reservation_config - list_reservations_config = parent_rpcs.list_reservations if parent_rpcs.respond_to? :list_reservations - @list_reservations = ::Gapic::Config::Method.new list_reservations_config - get_reservation_config = parent_rpcs.get_reservation if parent_rpcs.respond_to? :get_reservation - @get_reservation = ::Gapic::Config::Method.new get_reservation_config - delete_reservation_config = parent_rpcs.delete_reservation if parent_rpcs.respond_to? :delete_reservation - @delete_reservation = ::Gapic::Config::Method.new delete_reservation_config - update_reservation_config = parent_rpcs.update_reservation if parent_rpcs.respond_to? :update_reservation - @update_reservation = ::Gapic::Config::Method.new update_reservation_config - failover_reservation_config = parent_rpcs.failover_reservation if parent_rpcs.respond_to? :failover_reservation - @failover_reservation = ::Gapic::Config::Method.new failover_reservation_config - create_capacity_commitment_config = parent_rpcs.create_capacity_commitment if parent_rpcs.respond_to? :create_capacity_commitment - @create_capacity_commitment = ::Gapic::Config::Method.new create_capacity_commitment_config - list_capacity_commitments_config = parent_rpcs.list_capacity_commitments if parent_rpcs.respond_to? :list_capacity_commitments - @list_capacity_commitments = ::Gapic::Config::Method.new list_capacity_commitments_config - get_capacity_commitment_config = parent_rpcs.get_capacity_commitment if parent_rpcs.respond_to? :get_capacity_commitment - @get_capacity_commitment = ::Gapic::Config::Method.new get_capacity_commitment_config - delete_capacity_commitment_config = parent_rpcs.delete_capacity_commitment if parent_rpcs.respond_to? :delete_capacity_commitment - @delete_capacity_commitment = ::Gapic::Config::Method.new delete_capacity_commitment_config - update_capacity_commitment_config = parent_rpcs.update_capacity_commitment if parent_rpcs.respond_to? :update_capacity_commitment - @update_capacity_commitment = ::Gapic::Config::Method.new update_capacity_commitment_config - split_capacity_commitment_config = parent_rpcs.split_capacity_commitment if parent_rpcs.respond_to? :split_capacity_commitment - @split_capacity_commitment = ::Gapic::Config::Method.new split_capacity_commitment_config - merge_capacity_commitments_config = parent_rpcs.merge_capacity_commitments if parent_rpcs.respond_to? :merge_capacity_commitments - @merge_capacity_commitments = ::Gapic::Config::Method.new merge_capacity_commitments_config - create_assignment_config = parent_rpcs.create_assignment if parent_rpcs.respond_to? :create_assignment - @create_assignment = ::Gapic::Config::Method.new create_assignment_config - list_assignments_config = parent_rpcs.list_assignments if parent_rpcs.respond_to? :list_assignments - @list_assignments = ::Gapic::Config::Method.new list_assignments_config - delete_assignment_config = parent_rpcs.delete_assignment if parent_rpcs.respond_to? :delete_assignment - @delete_assignment = ::Gapic::Config::Method.new delete_assignment_config - search_assignments_config = parent_rpcs.search_assignments if parent_rpcs.respond_to? :search_assignments - @search_assignments = ::Gapic::Config::Method.new search_assignments_config - search_all_assignments_config = parent_rpcs.search_all_assignments if parent_rpcs.respond_to? :search_all_assignments - @search_all_assignments = ::Gapic::Config::Method.new search_all_assignments_config - move_assignment_config = parent_rpcs.move_assignment if parent_rpcs.respond_to? :move_assignment - @move_assignment = ::Gapic::Config::Method.new move_assignment_config - update_assignment_config = parent_rpcs.update_assignment if parent_rpcs.respond_to? :update_assignment - @update_assignment = ::Gapic::Config::Method.new update_assignment_config - get_bi_reservation_config = parent_rpcs.get_bi_reservation if parent_rpcs.respond_to? :get_bi_reservation - @get_bi_reservation = ::Gapic::Config::Method.new get_bi_reservation_config - update_bi_reservation_config = parent_rpcs.update_bi_reservation if parent_rpcs.respond_to? :update_bi_reservation - @update_bi_reservation = ::Gapic::Config::Method.new update_bi_reservation_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - create_reservation_group_config = parent_rpcs.create_reservation_group if parent_rpcs.respond_to? :create_reservation_group - @create_reservation_group = ::Gapic::Config::Method.new create_reservation_group_config - get_reservation_group_config = parent_rpcs.get_reservation_group if parent_rpcs.respond_to? :get_reservation_group - @get_reservation_group = ::Gapic::Config::Method.new get_reservation_group_config - delete_reservation_group_config = parent_rpcs.delete_reservation_group if parent_rpcs.respond_to? :delete_reservation_group - @delete_reservation_group = ::Gapic::Config::Method.new delete_reservation_group_config - list_reservation_groups_config = parent_rpcs.list_reservation_groups if parent_rpcs.respond_to? :list_reservation_groups - @list_reservation_groups = ::Gapic::Config::Method.new list_reservation_groups_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/service_stub.rb deleted file mode 100644 index d8fad30b5458..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/service_stub.rb +++ /dev/null @@ -1,1889 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/bigquery/reservation/v1/reservation_pb" - -module Google - module Cloud - module Bigquery - module Reservation - module V1 - module ReservationService - module Rest - ## - # REST service stub for the ReservationService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_reservation REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest] - # 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::Bigquery::Reservation::V1::Reservation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # A result object deserialized from the server's reply - def create_reservation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_reservation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_reservation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_reservations REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest] - # 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::Bigquery::Reservation::V1::ListReservationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::ListReservationsResponse] - # A result object deserialized from the server's reply - def list_reservations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_reservations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_reservations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_reservation REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest] - # 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::Bigquery::Reservation::V1::Reservation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # A result object deserialized from the server's reply - def get_reservation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_reservation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_reservation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_reservation REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_reservation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_reservation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_reservation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_reservation REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest] - # 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::Bigquery::Reservation::V1::Reservation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # A result object deserialized from the server's reply - def update_reservation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_reservation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_reservation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the failover_reservation REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest] - # 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::Bigquery::Reservation::V1::Reservation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # A result object deserialized from the server's reply - def failover_reservation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_failover_reservation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "failover_reservation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_capacity_commitment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest] - # 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::Bigquery::Reservation::V1::CapacityCommitment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # A result object deserialized from the server's reply - def create_capacity_commitment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_capacity_commitment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_capacity_commitment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_capacity_commitments REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest] - # 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::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse] - # A result object deserialized from the server's reply - def list_capacity_commitments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_capacity_commitments_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_capacity_commitments", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_capacity_commitment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest] - # 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::Bigquery::Reservation::V1::CapacityCommitment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # A result object deserialized from the server's reply - def get_capacity_commitment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_capacity_commitment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_capacity_commitment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_capacity_commitment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_capacity_commitment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_capacity_commitment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_capacity_commitment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_capacity_commitment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest] - # 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::Bigquery::Reservation::V1::CapacityCommitment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # A result object deserialized from the server's reply - def update_capacity_commitment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_capacity_commitment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_capacity_commitment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the split_capacity_commitment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest] - # 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::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse] - # A result object deserialized from the server's reply - def split_capacity_commitment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_split_capacity_commitment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "split_capacity_commitment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the merge_capacity_commitments REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest] - # 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::Bigquery::Reservation::V1::CapacityCommitment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # A result object deserialized from the server's reply - def merge_capacity_commitments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_merge_capacity_commitments_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "merge_capacity_commitments", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_assignment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest] - # 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::Bigquery::Reservation::V1::Assignment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # A result object deserialized from the server's reply - def create_assignment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_assignment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_assignment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_assignments REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest] - # 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::Bigquery::Reservation::V1::ListAssignmentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsResponse] - # A result object deserialized from the server's reply - def list_assignments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_assignments_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_assignments", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_assignment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_assignment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_assignment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_assignment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_assignments REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest] - # 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::Bigquery::Reservation::V1::SearchAssignmentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsResponse] - # A result object deserialized from the server's reply - def search_assignments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_assignments_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "search_assignments", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_all_assignments REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest] - # 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::Bigquery::Reservation::V1::SearchAllAssignmentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsResponse] - # A result object deserialized from the server's reply - def search_all_assignments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_all_assignments_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "search_all_assignments", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the move_assignment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest] - # 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::Bigquery::Reservation::V1::Assignment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # A result object deserialized from the server's reply - def move_assignment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_move_assignment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "move_assignment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_assignment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest] - # 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::Bigquery::Reservation::V1::Assignment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # A result object deserialized from the server's reply - def update_assignment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_assignment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_assignment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_bi_reservation REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest] - # 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::Bigquery::Reservation::V1::BiReservation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] - # A result object deserialized from the server's reply - def get_bi_reservation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_bi_reservation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_bi_reservation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::BiReservation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_bi_reservation REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest] - # 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::Bigquery::Reservation::V1::BiReservation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] - # A result object deserialized from the server's reply - def update_bi_reservation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_bi_reservation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_bi_reservation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::BiReservation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_reservation_group REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest] - # 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::Bigquery::Reservation::V1::ReservationGroup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] - # A result object deserialized from the server's reply - def create_reservation_group request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_reservation_group_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_reservation_group", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_reservation_group REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest] - # 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::Bigquery::Reservation::V1::ReservationGroup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] - # A result object deserialized from the server's reply - def get_reservation_group request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_reservation_group_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_reservation_group", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_reservation_group REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_reservation_group request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_reservation_group_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_reservation_group", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_reservation_groups REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest] - # 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::Bigquery::Reservation::V1::ListReservationGroupsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsResponse] - # A result object deserialized from the server's reply - def list_reservation_groups request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_reservation_groups_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_reservation_groups", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_reservation REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_reservation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/reservations", - body: "reservation", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_reservations REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_reservations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/reservations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_reservation REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_reservation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_reservation REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_reservation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_reservation REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_reservation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{reservation.name}", - body: "reservation", - matches: [ - ["reservation.name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the failover_reservation REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_failover_reservation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:failoverReservation", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_capacity_commitment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_capacity_commitment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/capacityCommitments", - body: "capacity_commitment", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_capacity_commitments REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_capacity_commitments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/capacityCommitments", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_capacity_commitment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_capacity_commitment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/capacityCommitments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_capacity_commitment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_capacity_commitment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/capacityCommitments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_capacity_commitment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_capacity_commitment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{capacity_commitment.name}", - body: "capacity_commitment", - matches: [ - ["capacity_commitment.name", %r{^projects/[^/]+/locations/[^/]+/capacityCommitments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the split_capacity_commitment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_split_capacity_commitment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:split", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/capacityCommitments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the merge_capacity_commitments REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_merge_capacity_commitments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/capacityCommitments:merge", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_assignment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_assignment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/assignments", - body: "assignment", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_assignments REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_assignments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/assignments", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_assignment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_assignment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_assignments REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_assignments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}:searchAssignments", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_all_assignments REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_all_assignments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}:searchAllAssignments", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the move_assignment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_move_assignment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:move", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_assignment REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_assignment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{assignment.name}", - body: "assignment", - matches: [ - ["assignment.name", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_bi_reservation REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_bi_reservation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/biReservation/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_bi_reservation REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_bi_reservation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{bi_reservation.name}", - body: "bi_reservation", - matches: [ - ["bi_reservation.name", %r{^projects/[^/]+/locations/[^/]+/biReservation/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_reservation_group REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_reservation_group_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/reservationGroups", - body: "reservation_group", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_reservation_group REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_reservation_group_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/reservationGroups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_reservation_group REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_reservation_group_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/reservationGroups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_reservation_groups REST call - # - # @param request_pb [::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_reservation_groups_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/reservationGroups", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_services_pb.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_services_pb.rb deleted file mode 100644 index 4f6d5bcb42f4..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_services_pb.rb +++ /dev/null @@ -1,297 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/bigquery/reservation/v1/reservation.proto for package 'google.cloud.bigquery.reservation.v1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/bigquery/reservation/v1/reservation_pb' - -module Google - module Cloud - module Bigquery - module Reservation - module V1 - module ReservationService - # This API allows users to manage their BigQuery reservations. - # - # A reservation provides computational resource guarantees, in the form of - # [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a - # unit of computational power in BigQuery, and serves as the basic unit of - # parallelism. In a scan of a multi-partitioned table, a single slot operates - # on a single partition of the table. A reservation resource exists as a child - # resource of the admin project and location, e.g.: - # `projects/myproject/locations/US/reservations/reservationName`. - # - # A capacity commitment is a way to purchase compute capacity for BigQuery jobs - # (in the form of slots) with some committed period of usage. A capacity - # commitment resource exists as a child resource of the admin project and - # location, e.g.: - # `projects/myproject/locations/US/capacityCommitments/id`. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.bigquery.reservation.v1.ReservationService' - - # Creates a new reservation resource. - rpc :CreateReservation, ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest, ::Google::Cloud::Bigquery::Reservation::V1::Reservation - # Lists all the reservations for the project in the specified location. - rpc :ListReservations, ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest, ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsResponse - # Returns information about the reservation. - rpc :GetReservation, ::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest, ::Google::Cloud::Bigquery::Reservation::V1::Reservation - # Deletes a reservation. - # Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has - # assignments. - rpc :DeleteReservation, ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest, ::Google::Protobuf::Empty - # Updates an existing reservation resource. - rpc :UpdateReservation, ::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest, ::Google::Cloud::Bigquery::Reservation::V1::Reservation - # Fail over a reservation to the secondary location. The operation should be - # done in the current secondary location, which will be promoted to the - # new primary location for the reservation. - # Attempting to failover a reservation in the current primary location will - # fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. - rpc :FailoverReservation, ::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest, ::Google::Cloud::Bigquery::Reservation::V1::Reservation - # Creates a new capacity commitment resource. - rpc :CreateCapacityCommitment, ::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest, ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment - # Lists all the capacity commitments for the admin project. - rpc :ListCapacityCommitments, ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest, ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse - # Returns information about the capacity commitment. - rpc :GetCapacityCommitment, ::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest, ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment - # Deletes a capacity commitment. Attempting to delete capacity commitment - # before its commitment_end_time will fail with the error code - # `google.rpc.Code.FAILED_PRECONDITION`. - rpc :DeleteCapacityCommitment, ::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest, ::Google::Protobuf::Empty - # Updates an existing capacity commitment. - # - # Only `plan` and `renewal_plan` fields can be updated. - # - # Plan can only be changed to a plan of a longer commitment period. - # Attempting to change to a plan with shorter commitment period will fail - # with the error code `google.rpc.Code.FAILED_PRECONDITION`. - rpc :UpdateCapacityCommitment, ::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest, ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment - # Splits capacity commitment to two commitments of the same plan and - # `commitment_end_time`. - # - # A common use case is to enable downgrading commitments. - # - # For example, in order to downgrade from 10000 slots to 8000, you might - # split a 10000 capacity commitment into commitments of 2000 and 8000. Then, - # you delete the first one after the commitment end time passes. - rpc :SplitCapacityCommitment, ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest, ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse - # Merges capacity commitments of the same plan into a single commitment. - # - # The resulting capacity commitment has the greater commitment_end_time - # out of the to-be-merged capacity commitments. - # - # Attempting to merge capacity commitments of different plan will fail - # with the error code `google.rpc.Code.FAILED_PRECONDITION`. - rpc :MergeCapacityCommitments, ::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest, ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment - # Creates an assignment object which allows the given project to submit jobs - # of a certain type using slots from the specified reservation. - # - # Currently a - # resource (project, folder, organization) can only have one assignment per - # each (job_type, location) combination, and that reservation will be used - # for all jobs of the matching type. - # - # Different assignments can be created on different levels of the - # projects, folders or organization hierarchy. During query execution, - # the assignment is looked up at the project, folder and organization levels - # in that order. The first assignment found is applied to the query. - # - # When creating assignments, it does not matter if other assignments exist at - # higher levels. - # - # Example: - # - # * The organization `organizationA` contains two projects, `project1` - # and `project2`. - # * Assignments for all three entities (`organizationA`, `project1`, and - # `project2`) could all be created and mapped to the same or different - # reservations. - # - # "None" assignments represent an absence of the assignment. Projects - # assigned to None use on-demand pricing. To create a "None" assignment, use - # "none" as a reservation_id in the parent. Example parent: - # `projects/myproject/locations/US/reservations/none`. - # - # Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have - # 'bigquery.admin' permissions on the project using the reservation - # and the project that owns this reservation. - # - # Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment - # does not match location of the reservation. - rpc :CreateAssignment, ::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest, ::Google::Cloud::Bigquery::Reservation::V1::Assignment - # Lists assignments. - # - # Only explicitly created assignments will be returned. - # - # Example: - # - # * Organization `organizationA` contains two projects, `project1` and - # `project2`. - # * Reservation `res1` exists and was created previously. - # * CreateAssignment was used previously to define the following - # associations between entities and reservations: `` - # and `` - # - # In this example, ListAssignments will just return the above two assignments - # for reservation `res1`, and no expansion/merge will happen. - # - # The wildcard "-" can be used for - # reservations in the request. In that case all assignments belongs to the - # specified project and location will be listed. - # - # **Note** "-" cannot be used for projects nor locations. - rpc :ListAssignments, ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest, ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsResponse - # Deletes a assignment. No expansion will happen. - # - # Example: - # - # * Organization `organizationA` contains two projects, `project1` and - # `project2`. - # * Reservation `res1` exists and was created previously. - # * CreateAssignment was used previously to define the following - # associations between entities and reservations: `` - # and `` - # - # In this example, deletion of the `` assignment won't - # affect the other assignment ``. After said deletion, - # queries from `project1` will still use `res1` while queries from - # `project2` will switch to use on-demand mode. - rpc :DeleteAssignment, ::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest, ::Google::Protobuf::Empty - # Deprecated: Looks up assignments for a specified resource for a particular - # region. If the request is about a project: - # - # 1. Assignments created on the project will be returned if they exist. - # 2. Otherwise assignments created on the closest ancestor will be - # returned. - # 3. Assignments for different JobTypes will all be returned. - # - # The same logic applies if the request is about a folder. - # - # If the request is about an organization, then assignments created on the - # organization will be returned (organization doesn't have ancestors). - # - # Comparing to ListAssignments, there are some behavior - # differences: - # - # 1. permission on the assignee will be verified in this API. - # 2. Hierarchy lookup (project->folder->organization) happens in this API. - # 3. Parent here is `projects/*/locations/*`, instead of - # `projects/*/locations/*reservations/*`. - # - # **Note** "-" cannot be used for projects - # nor locations. - rpc :SearchAssignments, ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest, ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsResponse - # Looks up assignments for a specified resource for a particular region. - # If the request is about a project: - # - # 1. Assignments created on the project will be returned if they exist. - # 2. Otherwise assignments created on the closest ancestor will be - # returned. - # 3. Assignments for different JobTypes will all be returned. - # - # The same logic applies if the request is about a folder. - # - # If the request is about an organization, then assignments created on the - # organization will be returned (organization doesn't have ancestors). - # - # Comparing to ListAssignments, there are some behavior - # differences: - # - # 1. permission on the assignee will be verified in this API. - # 2. Hierarchy lookup (project->folder->organization) happens in this API. - # 3. Parent here is `projects/*/locations/*`, instead of - # `projects/*/locations/*reservations/*`. - rpc :SearchAllAssignments, ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest, ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsResponse - # Moves an assignment under a new reservation. - # - # This differs from removing an existing assignment and recreating a new one - # by providing a transactional change that ensures an assignee always has an - # associated reservation. - rpc :MoveAssignment, ::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest, ::Google::Cloud::Bigquery::Reservation::V1::Assignment - # Updates an existing assignment. - # - # Only the `priority` field can be updated. - rpc :UpdateAssignment, ::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest, ::Google::Cloud::Bigquery::Reservation::V1::Assignment - # Retrieves a BI reservation. - rpc :GetBiReservation, ::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest, ::Google::Cloud::Bigquery::Reservation::V1::BiReservation - # Updates a BI reservation. - # - # Only fields specified in the `field_mask` are updated. - # - # A singleton BI reservation always exists with default size 0. - # In order to reserve BI capacity it needs to be updated to an amount - # greater than 0. In order to release BI capacity reservation size - # must be set to 0. - rpc :UpdateBiReservation, ::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest, ::Google::Cloud::Bigquery::Reservation::V1::BiReservation - # Gets the access control policy for a resource. - # May return: - # - # * A`NOT_FOUND` error if the resource doesn't exist or you don't have the - # permission to view it. - # * An empty policy if the resource exists but doesn't have a set policy. - # - # Supported resources are: - # - Reservations - # - ReservationAssignments - # - # To call this method, you must have the following Google IAM permissions: - # - # - `bigqueryreservation.reservations.getIamPolicy` to get policies on - # reservations. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Sets an access control policy for a resource. Replaces any existing - # policy. - # - # Supported resources are: - # - Reservations - # - # To call this method, you must have the following Google IAM permissions: - # - # - `bigqueryreservation.reservations.setIamPolicy` to set policies on - # reservations. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Gets your permissions on a resource. Returns an empty set of permissions if - # the resource doesn't exist. - # - # Supported resources are: - # - Reservations - # - # No Google IAM permissions are required to call this method. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - # Creates a new reservation group. - rpc :CreateReservationGroup, ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest, ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup - # Returns information about the reservation group. - rpc :GetReservationGroup, ::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest, ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup - # Deletes a reservation. - # Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has - # assignments. - rpc :DeleteReservationGroup, ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest, ::Google::Protobuf::Empty - # Lists all the reservation groups for the project in the specified location. - rpc :ListReservationGroups, ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest, ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/rest.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/rest.rb deleted file mode 100644 index 1cec46fd7cad..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/rest.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/bigquery/reservation/v1/reservation_service/rest" -require "google/cloud/bigquery/reservation/v1/version" - -module Google - module Cloud - module Bigquery - module Reservation - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/bigquery/reservation/v1/rest" - # client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new - # - module V1 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/version.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/version.rb deleted file mode 100644 index 30a621b3b473..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/version.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Bigquery - module Reservation - module V1 - VERSION = "0.0.1" - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/README.md deleted file mode 100644 index dcf8e9f79d59..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# BigQuery Reservation 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-bigquery-reservation-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/client.rb deleted file mode 100644 index c6b6b60729c9..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index fb9115c630af..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index b836bdb60b21..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 71b994c7ef20..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/cloud/bigquery/reservation/v1/reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/cloud/bigquery/reservation/v1/reservation.rb deleted file mode 100644 index fc8a9f0108d8..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/cloud/bigquery/reservation/v1/reservation.rb +++ /dev/null @@ -1,1190 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Bigquery - module Reservation - module V1 - # A reservation is a mechanism used to guarantee slots to users. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the reservation, e.g., - # `projects/*/locations/*/reservations/team1-prod`. - # The reservation_id must only contain lower case alphanumeric characters or - # dashes. It must start with a letter and must not end with a dash. Its - # maximum length is 64 characters. - # @!attribute [rw] slot_capacity - # @return [::Integer] - # Optional. Baseline slots available to this reservation. A slot is a unit of - # computational power in BigQuery, and serves as the unit of parallelism. - # - # Queries using this reservation might use more slots during runtime if - # ignore_idle_slots is set to false, or autoscaling is enabled. - # - # The total slot_capacity of the reservation and its siblings - # may exceed the total slot_count of capacity commitments. In that case, the - # exceeding slots will be charged with the autoscale SKU. You can increase - # the number of baseline slots in a reservation every few minutes. If you - # want to decrease your baseline slots, you are limited to once an hour if - # you have recently changed your baseline slot capacity and your baseline - # slots exceed your committed slots. Otherwise, you can decrease your - # baseline slots every few minutes. - # @!attribute [rw] ignore_idle_slots - # @return [::Boolean] - # Optional. If false, any query or pipeline job using this reservation will - # use idle slots from other reservations within the same admin project. If - # true, a query or pipeline job using this reservation will execute with the - # slot capacity specified in the slot_capacity field at most. - # @!attribute [rw] autoscale - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation::Autoscale] - # Optional. The configuration parameters for the auto scaling feature. - # @!attribute [rw] concurrency - # @return [::Integer] - # Optional. Job concurrency target which sets a soft upper bound on the - # number of jobs that can run concurrently in this reservation. This is a - # soft target due to asynchronous nature of the system and various - # optimizations for small queries. Default value is 0 which means that - # concurrency target will be automatically computed by the system. NOTE: this - # field is exposed as target job concurrency in the Information Schema, DDL - # and BigQuery CLI. - # @!attribute [r] creation_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of the reservation. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last update time of the reservation. - # @!attribute [rw] multi_region_auxiliary - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Applicable only for reservations located within one of the BigQuery - # multi-regions (US or EU). - # - # If set to true, this reservation is placed in the organization's - # secondary region which is designated for disaster recovery purposes. - # If false, this reservation is placed in the organization's default region. - # - # NOTE: this is a preview feature. Project must be allow-listed in order to - # set this field. - # @!attribute [rw] edition - # @return [::Google::Cloud::Bigquery::Reservation::V1::Edition] - # Optional. Edition of the reservation. - # @!attribute [r] primary_location - # @return [::String] - # Output only. The current location of the reservation's primary replica. - # This field is only set for reservations using the managed disaster recovery - # feature. - # @!attribute [rw] secondary_location - # @return [::String] - # Optional. The current location of the reservation's secondary replica. This - # field is only set for reservations using the managed disaster recovery - # feature. Users can set this in create reservation calls - # to create a failover reservation or in update reservation calls to convert - # a non-failover reservation to a failover reservation(or vice versa). - # @!attribute [r] original_primary_location - # @return [::String] - # Output only. The location where the reservation was originally created. - # This is set only during the failover reservation's creation. All billing - # charges for the failover reservation will be applied to this location. - # @!attribute [rw] max_slots - # @return [::Integer] - # Optional. The overall max slots for the reservation, covering slot_capacity - # (baseline), idle slots (if ignore_idle_slots is false) and scaled slots. - # If present, the reservation won't use more than the specified number of - # slots, even if there is demand and supply (from idle slots). - # NOTE: capping a reservation's idle slot usage is best effort and its - # usage may exceed the max_slots value. However, in terms of - # autoscale.current_slots (which accounts for the additional added slots), it - # will never exceed the max_slots - baseline. - # - # - # This field must be set together with the scaling_mode enum value, - # otherwise the request will be rejected with error code - # `google.rpc.Code.INVALID_ARGUMENT`. - # - # If the max_slots and scaling_mode are set, the autoscale or - # autoscale.max_slots field must be unset. Otherwise the request will be - # rejected with error code `google.rpc.Code.INVALID_ARGUMENT`. However, the - # autoscale field may still be in the output. The autopscale.max_slots will - # always show as 0 and the autoscaler.current_slots will represent the - # current slots from autoscaler excluding idle slots. - # For example, if the max_slots is 1000 and scaling_mode is AUTOSCALE_ONLY, - # then in the output, the autoscaler.max_slots will be 0 and the - # autoscaler.current_slots may be any value between 0 and 1000. - # - # If the max_slots is 1000, scaling_mode is ALL_SLOTS, the baseline is 100 - # and idle slots usage is 200, then in the output, the autoscaler.max_slots - # will be 0 and the autoscaler.current_slots will not be higher than 700. - # - # If the max_slots is 1000, scaling_mode is IDLE_SLOTS_ONLY, then in the - # output, the autoscaler field will be null. - # - # If the max_slots and scaling_mode are set, then the ignore_idle_slots field - # must be aligned with the scaling_mode enum value.(See details in - # ScalingMode comments). Otherwise the request will be rejected with - # error code `google.rpc.Code.INVALID_ARGUMENT`. - # - # Please note, the max_slots is for user to manage the part of slots greater - # than the baseline. Therefore, we don't allow users to set max_slots smaller - # or equal to the baseline as it will not be meaningful. If the field is - # present and slot_capacity>=max_slots, requests will be rejected with error - # code `google.rpc.Code.INVALID_ARGUMENT`. - # - # Please note that if max_slots is set to 0, we will treat it as unset. - # Customers can set max_slots to 0 and set scaling_mode to - # SCALING_MODE_UNSPECIFIED to disable the max_slots feature. - # @!attribute [rw] scaling_mode - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation::ScalingMode] - # Optional. The scaling mode for the reservation. - # If the field is present but max_slots is not present, requests will be - # rejected with error code `google.rpc.Code.INVALID_ARGUMENT`. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels associated with this reservation. You can use these - # to organize and group your reservations. - # You can set this property when you create or update a reservation. - # @!attribute [rw] reservation_group - # @return [::String] - # Optional. The reservation group that this reservation belongs to. - # You can set this property when you create or update a reservation. - # Reservations do not need to belong to a reservation group. - # Format: - # projects/\\{project}/locations/\\{location}/reservationGroups/\\{reservation_group} - # or just \\{reservation_group} - # @!attribute [r] replication_status - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation::ReplicationStatus] - # Output only. The Disaster Recovery(DR) replication status of the - # reservation. This is only available for the primary replicas of DR/failover - # reservations and provides information about the both the staleness of the - # secondary and the last error encountered while trying to replicate changes - # from the primary to the secondary. If this field is blank, it means that - # the reservation is either not a DR reservation or the reservation is a DR - # secondary or that any replication operations on the reservation have - # succeeded. - # @!attribute [rw] scheduling_policy - # @return [::Google::Cloud::Bigquery::Reservation::V1::SchedulingPolicy] - # Optional. The scheduling policy to use for jobs and queries running under - # this reservation. The scheduling policy controls how the reservation's - # resources are distributed. - # - # This feature is not yet generally available. - class Reservation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Auto scaling settings. - # @!attribute [r] current_slots - # @return [::Integer] - # Output only. The slot capacity added to this reservation when autoscale - # happens. Will be between [0, max_slots]. Note: after users reduce - # max_slots, it may take a while before it can be propagated, so - # current_slots may stay in the original value and could be larger than - # max_slots for that brief period (less than one minute) - # @!attribute [rw] max_slots - # @return [::Integer] - # Optional. Number of slots to be scaled when needed. - class Autoscale - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Disaster Recovery(DR) replication status of the reservation. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. The last error encountered while trying to replicate changes - # from the primary to the secondary. This field is only available if the - # replication has not succeeded since. - # @!attribute [r] last_error_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the last error was encountered while - # trying to replicate changes from the primary to the secondary. This field - # is only available if the replication has not succeeded since. - # @!attribute [r] last_replication_time - # @return [::Google::Protobuf::Timestamp] - # Output only. A timestamp corresponding to the last change on the primary - # that was successfully replicated to the secondary. - # @!attribute [r] soft_failover_start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which a soft failover for the reservation and - # its associated datasets was initiated. After this field is set, all - # subsequent changes to the reservation will be rejected unless a hard - # failover overrides this operation. This field will be cleared once the - # failover is complete. - class ReplicationStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The scaling mode for the reservation. This enum determines how the - # reservation scales up and down. - module ScalingMode - # Default value of ScalingMode. - SCALING_MODE_UNSPECIFIED = 0 - - # The reservation will scale up only using slots from autoscaling. It will - # not use any idle slots even if there may be some available. The upper - # limit that autoscaling can scale up to will be max_slots - baseline. - # For example, if max_slots is 1000, baseline is 200 and customer sets - # ScalingMode to AUTOSCALE_ONLY, then autoscalerg will scale up to 800 - # slots and no idle slots will be used. - # - # Please note, in this mode, the ignore_idle_slots field must be set to - # true. Otherwise the request will be rejected with error code - # `google.rpc.Code.INVALID_ARGUMENT`. - AUTOSCALE_ONLY = 1 - - # The reservation will scale up using only idle slots contributed by - # other reservations or from unassigned commitments. If no idle slots are - # available it will not scale up further. If the idle slots which it is - # using are reclaimed by the contributing reservation(s) it may be forced - # to scale down. The max idle slots the reservation can be max_slots - - # baseline capacity. For example, if max_slots is 1000, baseline is 200 and - # customer sets ScalingMode to IDLE_SLOTS_ONLY, - # 1. if there are 1000 idle slots available in other reservations, the - # reservation will scale up to 1000 slots with 200 baseline and 800 idle - # slots. - # 2. if there are 500 idle slots available in other reservations, the - # reservation will scale up to 700 slots with 200 baseline and 300 idle - # slots. - # Please note, in this mode, the reservation might not be able to scale up - # to max_slots. - # - # Please note, in this mode, the ignore_idle_slots field must be set to - # false. Otherwise the request will be rejected with error code - # `google.rpc.Code.INVALID_ARGUMENT`. - IDLE_SLOTS_ONLY = 2 - - # The reservation will scale up using all slots available to it. It will - # use idle slots contributed by other reservations or from unassigned - # commitments first. If no idle slots are available it will scale up using - # autoscaling. For example, if max_slots is 1000, baseline is 200 and - # customer sets ScalingMode to ALL_SLOTS, - # 1. if there are 800 idle slots available in other reservations, the - # reservation will scale up to 1000 slots with 200 baseline and 800 idle - # slots. - # 2. if there are 500 idle slots available in other reservations, the - # reservation will scale up to 1000 slots with 200 baseline, 500 idle - # slots and 300 autoscaling slots. - # 3. if there are no idle slots available in other reservations, it will - # scale up to 1000 slots with 200 baseline and 800 autoscaling slots. - # - # Please note, in this mode, the ignore_idle_slots field must be set to - # false. Otherwise the request will be rejected with error code - # `google.rpc.Code.INVALID_ARGUMENT`. - ALL_SLOTS = 3 - end - end - - # The scheduling policy controls how a reservation's resources are distributed. - # @!attribute [rw] concurrency - # @return [::Integer] - # Optional. If present and > 0, the reservation will attempt to limit the - # concurrency of jobs running for any particular project within it to the - # given value. - # - # This feature is not yet generally available. - # @!attribute [rw] max_slots - # @return [::Integer] - # Optional. If present and > 0, the reservation will attempt to limit the - # slot consumption of queries running for any particular project within it to - # the given value. - # - # This feature is not yet generally available. - class SchedulingPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A reservation group is a container for reservations. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the reservation group, e.g., - # `projects/*/locations/*/reservationGroups/team1-prod`. - # The reservation_group_id must only contain lower case alphanumeric - # characters or dashes. It must start with a letter and must not end with a - # dash. Its maximum length is 64 characters. - class ReservationGroup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Capacity commitment is a way to purchase compute capacity for BigQuery jobs - # (in the form of slots) with some committed period of usage. Annual - # commitments renew by default. Commitments can be removed after their - # commitment end time passes. - # - # In order to remove annual commitment, its plan needs to be changed - # to monthly or flex first. - # - # A capacity commitment resource exists as a child resource of the admin - # project. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the capacity commitment, e.g., - # `projects/myproject/locations/US/capacityCommitments/123` - # The commitment_id must only contain lower case alphanumeric characters or - # dashes. It must start with a letter and must not end - # with a dash. Its maximum length is 64 characters. - # @!attribute [rw] slot_count - # @return [::Integer] - # Optional. Number of slots in this commitment. - # @!attribute [rw] plan - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::CommitmentPlan] - # Optional. Capacity commitment commitment plan. - # @!attribute [r] state - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::State] - # Output only. State of the commitment. - # @!attribute [r] commitment_start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The start of the current commitment period. It is applicable - # only for ACTIVE capacity commitments. Note after the commitment is renewed, - # commitment_start_time won't be changed. It refers to the start time of the - # original commitment. - # @!attribute [r] commitment_end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The end of the current commitment period. It is applicable - # only for ACTIVE capacity commitments. Note after renewal, - # commitment_end_time is the time the renewed commitment expires. So itwould - # be at a time after commitment_start_time + committed period, because we - # don't change commitment_start_time , - # @!attribute [r] failure_status - # @return [::Google::Rpc::Status] - # Output only. For FAILED commitment plan, provides the reason of failure. - # @!attribute [rw] renewal_plan - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment::CommitmentPlan] - # Optional. The plan this capacity commitment is converted to after - # commitment_end_time passes. Once the plan is changed, committed period is - # extended according to commitment plan. Only applicable for ANNUAL and TRIAL - # commitments. - # @!attribute [rw] multi_region_auxiliary - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Applicable only for commitments located within one of the BigQuery - # multi-regions (US or EU). - # - # If set to true, this commitment is placed in the organization's - # secondary region which is designated for disaster recovery purposes. - # If false, this commitment is placed in the organization's default region. - # - # NOTE: this is a preview feature. Project must be allow-listed in order to - # set this field. - # @!attribute [rw] edition - # @return [::Google::Cloud::Bigquery::Reservation::V1::Edition] - # Optional. Edition of the capacity commitment. - # @!attribute [r] is_flat_rate - # @return [::Boolean] - # Output only. If true, the commitment is a flat-rate commitment, otherwise, - # it's an edition commitment. - class CapacityCommitment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Commitment plan defines the current committed period. Capacity commitment - # cannot be deleted during it's committed period. - module CommitmentPlan - # Invalid plan value. Requests with this value will be rejected with - # error code `google.rpc.Code.INVALID_ARGUMENT`. - COMMITMENT_PLAN_UNSPECIFIED = 0 - - # Flex commitments have committed period of 1 minute after becoming ACTIVE. - # After that, they are not in a committed period anymore and can be removed - # any time. - FLEX = 3 - - # Same as FLEX, should only be used if flat-rate commitments are still - # available. - FLEX_FLAT_RATE = 7 - - # Trial commitments have a committed period of 182 days after becoming - # ACTIVE. After that, they are converted to a new commitment based on the - # `renewal_plan`. Default `renewal_plan` for Trial commitment is Flex so - # that it can be deleted right after committed period ends. - TRIAL = 5 - - # Monthly commitments have a committed period of 30 days after becoming - # ACTIVE. After that, they are not in a committed period anymore and can be - # removed any time. - MONTHLY = 2 - - # Same as MONTHLY, should only be used if flat-rate commitments are still - # available. - MONTHLY_FLAT_RATE = 8 - - # Annual commitments have a committed period of 365 days after becoming - # ACTIVE. After that they are converted to a new commitment based on the - # renewal_plan. - ANNUAL = 4 - - # Same as ANNUAL, should only be used if flat-rate commitments are still - # available. - ANNUAL_FLAT_RATE = 9 - - # 3-year commitments have a committed period of 1095(3 * 365) days after - # becoming ACTIVE. After that they are converted to a new commitment based - # on the renewal_plan. - THREE_YEAR = 10 - - # Should only be used for `renewal_plan` and is only meaningful if - # edition is specified to values other than EDITION_UNSPECIFIED. Otherwise - # CreateCapacityCommitmentRequest or UpdateCapacityCommitmentRequest will - # be rejected with error code `google.rpc.Code.INVALID_ARGUMENT`. If the - # renewal_plan is NONE, capacity commitment will be removed at the end of - # its commitment period. - NONE = 6 - end - - # Capacity commitment can either become ACTIVE right away or transition - # from PENDING to ACTIVE or FAILED. - module State - # Invalid state value. - STATE_UNSPECIFIED = 0 - - # Capacity commitment is pending provisioning. Pending capacity commitment - # does not contribute to the project's slot_capacity. - PENDING = 1 - - # Once slots are provisioned, capacity commitment becomes active. - # slot_count is added to the project's slot_capacity. - ACTIVE = 2 - - # Capacity commitment is failed to be activated by the backend. - FAILED = 3 - end - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_reservation ReservationService.CreateReservation}. - # @!attribute [rw] parent - # @return [::String] - # Required. Project, location. E.g., - # `projects/myproject/locations/US` - # @!attribute [rw] reservation_id - # @return [::String] - # The reservation ID. It must only contain lower case alphanumeric - # characters or dashes. It must start with a letter and must not end - # with a dash. Its maximum length is 64 characters. - # @!attribute [rw] reservation - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # Definition of the new reservation to create. - class CreateReservationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservations ReservationService.ListReservations}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name containing project and location, e.g.: - # `projects/myproject/locations/US` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return per page. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous List request, if any. - class ListReservationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservations ReservationService.ListReservations}. - # @!attribute [rw] reservations - # @return [::Array<::Google::Cloud::Bigquery::Reservation::V1::Reservation>] - # List of reservations visible to the user. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListReservationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_reservation ReservationService.GetReservation}. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the reservation to retrieve. E.g., - # `projects/myproject/locations/US/reservations/team1-prod` - class GetReservationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation ReservationService.DeleteReservation}. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the reservation to retrieve. E.g., - # `projects/myproject/locations/US/reservations/team1-prod` - class DeleteReservationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_reservation ReservationService.UpdateReservation}. - # @!attribute [rw] reservation - # @return [::Google::Cloud::Bigquery::Reservation::V1::Reservation] - # Content of the reservation to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Standard field mask for the set of fields to be updated. - class UpdateReservationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for ReservationService.FailoverReservation. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the reservation to failover. E.g., - # `projects/myproject/locations/US/reservations/team1-prod` - # @!attribute [rw] failover_mode - # @return [::Google::Cloud::Bigquery::Reservation::V1::FailoverMode] - # Optional. A parameter that determines how writes that are pending - # replication are handled after a failover is initiated. If not specified, - # HARD failover mode is used by default. - class FailoverReservationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_reservation_group ReservationService.CreateReservationGroup}. - # @!attribute [rw] parent - # @return [::String] - # Required. Project, location. E.g., - # `projects/myproject/locations/US` - # @!attribute [rw] reservation_group_id - # @return [::String] - # Required. The reservation group ID. It must only contain lower case - # alphanumeric characters or dashes. It must start with a letter and must not - # end with a dash. Its maximum length is 64 characters. - # @!attribute [rw] reservation_group - # @return [::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup] - # Required. New Reservation Group to create. - class CreateReservationGroupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_reservation_group ReservationService.GetReservationGroup}. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the reservation group to retrieve. E.g., - # `projects/myproject/locations/US/reservationGroups/team1-prod` - class GetReservationGroupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservation_groups ReservationService.ListReservationGroups}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name containing project and location, e.g.: - # `projects/myproject/locations/US` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return per page. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous List request, if any. - class ListReservationGroupsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservation_groups ReservationService.ListReservationGroups}. - # @!attribute [rw] reservation_groups - # @return [::Array<::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup>] - # List of reservations visible to the user. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListReservationGroupsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation_group ReservationService.DeleteReservationGroup}. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the reservation group to retrieve. E.g., - # `projects/myproject/locations/US/reservationGroups/team1-prod` - class DeleteReservationGroupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_capacity_commitment ReservationService.CreateCapacityCommitment}. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the parent reservation. E.g., - # `projects/myproject/locations/US` - # @!attribute [rw] capacity_commitment - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # Content of the capacity commitment to create. - # @!attribute [rw] enforce_single_admin_project_per_org - # @return [::Boolean] - # If true, fail the request if another project in the organization has a - # capacity commitment. - # @!attribute [rw] capacity_commitment_id - # @return [::String] - # The optional capacity commitment ID. Capacity commitment name will be - # generated automatically if this field is empty. - # This field must only contain lower case alphanumeric characters or dashes. - # The first and last character cannot be a dash. Max length is 64 characters. - # NOTE: this ID won't be kept if the capacity commitment is split or merged. - class CreateCapacityCommitmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_capacity_commitments ReservationService.ListCapacityCommitments}. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the parent reservation. E.g., - # `projects/myproject/locations/US` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous List request, if any. - class ListCapacityCommitmentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_capacity_commitments ReservationService.ListCapacityCommitments}. - # @!attribute [rw] capacity_commitments - # @return [::Array<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>] - # List of capacity commitments visible to the user. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListCapacityCommitmentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_capacity_commitment ReservationService.GetCapacityCommitment}. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the capacity commitment to retrieve. E.g., - # `projects/myproject/locations/US/capacityCommitments/123` - class GetCapacityCommitmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_capacity_commitment ReservationService.DeleteCapacityCommitment}. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the capacity commitment to delete. E.g., - # `projects/myproject/locations/US/capacityCommitments/123` - # @!attribute [rw] force - # @return [::Boolean] - # Can be used to force delete commitments even if assignments exist. Deleting - # commitments with assignments may cause queries to fail if they no longer - # have access to slots. - class DeleteCapacityCommitmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_capacity_commitment ReservationService.UpdateCapacityCommitment}. - # @!attribute [rw] capacity_commitment - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # Content of the capacity commitment to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Standard field mask for the set of fields to be updated. - class UpdateCapacityCommitmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#split_capacity_commitment ReservationService.SplitCapacityCommitment}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name e.g.,: - # `projects/myproject/locations/US/capacityCommitments/123` - # @!attribute [rw] slot_count - # @return [::Integer] - # Number of slots in the capacity commitment after the split. - class SplitCapacityCommitmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#split_capacity_commitment ReservationService.SplitCapacityCommitment}. - # @!attribute [rw] first - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # First capacity commitment, result of a split. - # @!attribute [rw] second - # @return [::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment] - # Second capacity commitment, result of a split. - class SplitCapacityCommitmentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#merge_capacity_commitments ReservationService.MergeCapacityCommitments}. - # @!attribute [rw] parent - # @return [::String] - # Parent resource that identifies admin project and location e.g., - # `projects/myproject/locations/us` - # @!attribute [rw] capacity_commitment_ids - # @return [::Array<::String>] - # Ids of capacity commitments to merge. - # These capacity commitments must exist under admin project and location - # specified in the parent. - # ID is the last portion of capacity commitment name e.g., 'abc' for - # projects/myproject/locations/US/capacityCommitments/abc - # @!attribute [rw] capacity_commitment_id - # @return [::String] - # Optional. The optional resulting capacity commitment ID. Capacity - # commitment name will be generated automatically if this field is empty. - # This field must only contain lower case alphanumeric characters or dashes. - # The first and last character cannot be a dash. Max length is 64 characters. - class MergeCapacityCommitmentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An assignment allows a project to submit jobs - # of a certain type using slots from the specified reservation. - # @!attribute [r] name - # @return [::String] - # Output only. Name of the resource. E.g.: - # `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. - # The assignment_id must only contain lower case alphanumeric characters or - # dashes and the max length is 64 characters. - # @!attribute [rw] assignee - # @return [::String] - # Optional. The resource which will use the reservation. E.g. - # `projects/myproject`, `folders/123`, or `organizations/456`. - # @!attribute [rw] job_type - # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment::JobType] - # Optional. Which type of jobs will use the reservation. - # @!attribute [r] state - # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment::State] - # Output only. State of the assignment. - # @!attribute [rw] enable_gemini_in_bigquery - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Optional. Deprecated: "Gemini in BigQuery" is now available by - # default for all BigQuery editions and should not be explicitly set. - # Controls if "Gemini in BigQuery" - # (https://cloud.google.com/gemini/docs/bigquery/overview) features should be - # enabled for this reservation assignment. - # @!attribute [rw] scheduling_policy - # @return [::Google::Cloud::Bigquery::Reservation::V1::SchedulingPolicy] - # Optional. The scheduling policy to use for jobs and queries of this - # assignee when running under the associated reservation. The scheduling - # policy controls how the reservation's resources are distributed. This - # overrides the default scheduling policy specified on the reservation. - # - # This feature is not yet generally available. - class Assignment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Types of job, which could be specified when using the reservation. - module JobType - # Invalid type. Requests with this value will be rejected with - # error code `google.rpc.Code.INVALID_ARGUMENT`. - JOB_TYPE_UNSPECIFIED = 0 - - # Pipeline (load/export) jobs from the project will use the reservation. - PIPELINE = 1 - - # Query jobs from the project will use the reservation. - QUERY = 2 - - # BigQuery ML jobs that use services external to BigQuery for model - # training. These jobs will not utilize idle slots from other reservations. - ML_EXTERNAL = 3 - - # Background jobs that BigQuery runs for the customers in the background. - BACKGROUND = 4 - - # Continuous SQL jobs will use this reservation. Reservations with - # continuous assignments cannot be mixed with non-continuous assignments. - CONTINUOUS = 6 - - # Finer granularity background jobs for capturing changes in a source - # database and streaming them into BigQuery. Reservations with this job - # type take priority over a default BACKGROUND reservation assignment (if - # it exists). - BACKGROUND_CHANGE_DATA_CAPTURE = 7 - - # Finer granularity background jobs for refreshing cached metadata for - # BigQuery tables. Reservations with this job type take priority over a - # default BACKGROUND reservation assignment (if it exists). - BACKGROUND_COLUMN_METADATA_INDEX = 8 - - # Finer granularity background jobs for refreshing search indexes upon - # BigQuery table columns. Reservations with this job type - # take priority over a default BACKGROUND reservation assignment (if it - # exists). - BACKGROUND_SEARCH_INDEX_REFRESH = 9 - end - - # Assignment will remain in PENDING state if no active capacity commitment is - # present. It will become ACTIVE when some capacity commitment becomes - # active. - module State - # Invalid state value. - STATE_UNSPECIFIED = 0 - - # Queries from assignee will be executed as on-demand, if related - # assignment is pending. - PENDING = 1 - - # Assignment is ready. - ACTIVE = 2 - end - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_assignment ReservationService.CreateAssignment}. - # Note: "bigquery.reservationAssignments.create" permission is required on the - # related assignee. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name of the assignment - # E.g. `projects/myproject/locations/US/reservations/team1-prod` - # @!attribute [rw] assignment - # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # Assignment resource to create. - # @!attribute [rw] assignment_id - # @return [::String] - # The optional assignment ID. Assignment name will be generated automatically - # if this field is empty. - # This field must only contain lower case alphanumeric characters or dashes. - # Max length is 64 characters. - class CreateAssignmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_assignments ReservationService.ListAssignments}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name e.g.: - # - # `projects/myproject/locations/US/reservations/team1-prod` - # - # Or: - # - # `projects/myproject/locations/US/reservations/-` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return per page. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous List request, if any. - class ListAssignmentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_assignments ReservationService.ListAssignments}. - # @!attribute [rw] assignments - # @return [::Array<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] - # List of assignments visible to the user. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListAssignmentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_assignment ReservationService.DeleteAssignment}. - # Note: "bigquery.reservationAssignments.delete" permission is required on the - # related assignee. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource, e.g. - # `projects/myproject/locations/US/reservations/team1-prod/assignments/123` - class DeleteAssignmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_assignments ReservationService.SearchAssignments}. - # Note: "bigquery.reservationAssignments.search" permission is required on the - # related assignee. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the admin project(containing project and - # location), e.g.: - # `projects/myproject/locations/US`. - # @!attribute [rw] query - # @return [::String] - # Please specify resource name as assignee in the query. - # - # Examples: - # - # * `assignee=projects/myproject` - # * `assignee=folders/123` - # * `assignee=organizations/456` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return per page. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous List request, if any. - class SearchAssignmentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_all_assignments ReservationService.SearchAllAssignments}. - # Note: "bigquery.reservationAssignments.search" permission is required on the - # related assignee. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name with location (project name could be the - # wildcard '-'), e.g.: - # `projects/-/locations/US`. - # @!attribute [rw] query - # @return [::String] - # Please specify resource name as assignee in the query. - # - # Examples: - # - # * `assignee=projects/myproject` - # * `assignee=folders/123` - # * `assignee=organizations/456` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return per page. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous List request, if any. - class SearchAllAssignmentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_assignments ReservationService.SearchAssignments}. - # @!attribute [rw] assignments - # @return [::Array<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] - # List of assignments visible to the user. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class SearchAssignmentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_all_assignments ReservationService.SearchAllAssignments}. - # @!attribute [rw] assignments - # @return [::Array<::Google::Cloud::Bigquery::Reservation::V1::Assignment>] - # List of assignments visible to the user. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class SearchAllAssignmentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#move_assignment ReservationService.MoveAssignment}. - # - # **Note**: "bigquery.reservationAssignments.create" permission is required on - # the destination_id. - # - # **Note**: "bigquery.reservationAssignments.create" and - # "bigquery.reservationAssignments.delete" permission are required on the - # related assignee. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the assignment, - # e.g. - # `projects/myproject/locations/US/reservations/team1-prod/assignments/123` - # @!attribute [rw] destination_id - # @return [::String] - # The new reservation ID, e.g.: - # `projects/myotherproject/locations/US/reservations/team2-prod` - # @!attribute [rw] assignment_id - # @return [::String] - # The optional assignment ID. A new assignment name is generated if this - # field is empty. - # - # This field can contain only lowercase alphanumeric characters or dashes. - # Max length is 64 characters. - class MoveAssignmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for - # {::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_assignment ReservationService.UpdateAssignment}. - # @!attribute [rw] assignment - # @return [::Google::Cloud::Bigquery::Reservation::V1::Assignment] - # Content of the assignment to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Standard field mask for the set of fields to be updated. - class UpdateAssignmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Fully qualified reference to BigQuery table. - # Internally stored as google.cloud.bi.v1.BqTableReference. - # @!attribute [rw] project_id - # @return [::String] - # Optional. The assigned project ID of the project. - # @!attribute [rw] dataset_id - # @return [::String] - # Optional. The ID of the dataset in the above project. - # @!attribute [rw] table_id - # @return [::String] - # Optional. The ID of the table in the above dataset. - class TableReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a BI Reservation. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the singleton BI reservation. - # Reservation names have the form - # `projects/{project_id}/locations/{location_id}/biReservation`. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last update timestamp of a reservation. - # @!attribute [rw] size - # @return [::Integer] - # Optional. Size of a reservation, in bytes. - # @!attribute [rw] preferred_tables - # @return [::Array<::Google::Cloud::Bigquery::Reservation::V1::TableReference>] - # Optional. Preferred tables to use BI capacity for. - class BiReservation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to get a singleton BI reservation. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the requested reservation, for example: - # `projects/{project_id}/locations/{location_id}/biReservation` - class GetBiReservationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to update a BI reservation. - # @!attribute [rw] bi_reservation - # @return [::Google::Cloud::Bigquery::Reservation::V1::BiReservation] - # A reservation to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # A list of fields to be updated in this request. - class UpdateBiReservationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of editions. - # Different features and behaviors are provided to different editions - # Capacity commitments and reservations are linked to editions. - module Edition - # Default value, which will be treated as ENTERPRISE. - EDITION_UNSPECIFIED = 0 - - # Standard edition. - STANDARD = 1 - - # Enterprise edition. - ENTERPRISE = 2 - - # Enterprise Plus edition. - ENTERPRISE_PLUS = 3 - end - - # The failover mode when a user initiates a failover on a reservation - # determines how writes that are pending replication are handled after the - # failover is initiated. - module FailoverMode - # Invalid value. - FAILOVER_MODE_UNSPECIFIED = 0 - - # When customers initiate a soft failover, BigQuery will wait until all - # committed writes are replicated to the secondary. This mode requires both - # regions to be available for the failover to succeed and prevents data loss. - SOFT = 1 - - # When customers initiate a hard failover, BigQuery will not wait until all - # committed writes are replicated to the secondary. There can be data loss - # for hard failover. - HARD = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index fbee4c39d435..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 848f8c2f7895..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 79fdbd1e2eff..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 9e9bdbb09ea4..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index 341efa296c29..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index c2acab1235a9..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index ad3c3ad25f0f..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index a005f395ccab..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index 3f61f95b2587..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 9505eeb8657e..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/Gemfile deleted file mode 100644 index 5c580f596f83..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-bigquery-reservation-v1", path: "../" -else - gem "google-cloud-bigquery-reservation-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-bigquery-reservation-v1/snippets/reservation_service/create_assignment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_assignment.rb deleted file mode 100644 index ae55a1a64f97..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_assignment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_CreateAssignment_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the create_assignment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#create_assignment. -# -def create_assignment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new - - # Call the create_assignment method. - result = client.create_assignment request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_CreateAssignment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_capacity_commitment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_capacity_commitment.rb deleted file mode 100644 index 45696eb75614..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_capacity_commitment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the create_capacity_commitment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#create_capacity_commitment. -# -def create_capacity_commitment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new - - # Call the create_capacity_commitment method. - result = client.create_capacity_commitment request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation.rb deleted file mode 100644 index f654b0aafd72..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_CreateReservation_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the create_reservation call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#create_reservation. -# -def create_reservation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new - - # Call the create_reservation method. - result = client.create_reservation request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_CreateReservation_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation_group.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation_group.rb deleted file mode 100644 index 2798b7b6821c..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation_group.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_CreateReservationGroup_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the create_reservation_group call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#create_reservation_group. -# -def create_reservation_group - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest.new - - # Call the create_reservation_group method. - result = client.create_reservation_group request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_CreateReservationGroup_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_assignment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_assignment.rb deleted file mode 100644 index 2c69e562d345..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_assignment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the delete_assignment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#delete_assignment. -# -def delete_assignment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new - - # Call the delete_assignment method. - result = client.delete_assignment request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_capacity_commitment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_capacity_commitment.rb deleted file mode 100644 index 009e37d621a1..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_capacity_commitment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the delete_capacity_commitment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#delete_capacity_commitment. -# -def delete_capacity_commitment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new - - # Call the delete_capacity_commitment method. - result = client.delete_capacity_commitment request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation.rb deleted file mode 100644 index 0bccc4f64480..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_DeleteReservation_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the delete_reservation call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation. -# -def delete_reservation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new - - # Call the delete_reservation method. - result = client.delete_reservation request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_DeleteReservation_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation_group.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation_group.rb deleted file mode 100644 index b54f2a5229b5..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation_group.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_DeleteReservationGroup_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the delete_reservation_group call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation_group. -# -def delete_reservation_group - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest.new - - # Call the delete_reservation_group method. - result = client.delete_reservation_group request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_DeleteReservationGroup_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/failover_reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/failover_reservation.rb deleted file mode 100644 index 828530c74a80..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/failover_reservation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_FailoverReservation_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the failover_reservation call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#failover_reservation. -# -def failover_reservation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest.new - - # Call the failover_reservation method. - result = client.failover_reservation request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_FailoverReservation_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_bi_reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_bi_reservation.rb deleted file mode 100644 index e8bc86c411d3..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_bi_reservation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_GetBiReservation_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the get_bi_reservation call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#get_bi_reservation. -# -def get_bi_reservation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new - - # Call the get_bi_reservation method. - result = client.get_bi_reservation request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_GetBiReservation_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_capacity_commitment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_capacity_commitment.rb deleted file mode 100644 index 1eda6f799ad4..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_capacity_commitment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the get_capacity_commitment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#get_capacity_commitment. -# -def get_capacity_commitment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new - - # Call the get_capacity_commitment method. - result = client.get_capacity_commitment request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_iam_policy.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_iam_policy.rb deleted file mode 100644 index e6b4fb3c22d4..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_GetIamPolicy_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the get_iam_policy call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation.rb deleted file mode 100644 index da8259b65e0e..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_GetReservation_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the get_reservation call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#get_reservation. -# -def get_reservation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new - - # Call the get_reservation method. - result = client.get_reservation request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_GetReservation_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation_group.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation_group.rb deleted file mode 100644 index 8d3a33dc524f..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation_group.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_GetReservationGroup_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the get_reservation_group call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#get_reservation_group. -# -def get_reservation_group - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest.new - - # Call the get_reservation_group method. - result = client.get_reservation_group request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_GetReservationGroup_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_assignments.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_assignments.rb deleted file mode 100644 index 2f2ca7bb8ef2..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_assignments.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_ListAssignments_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the list_assignments call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#list_assignments. -# -def list_assignments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new - - # Call the list_assignments method. - result = client.list_assignments request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. - p item - end -end -# [END bigqueryreservation_v1_generated_ReservationService_ListAssignments_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_capacity_commitments.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_capacity_commitments.rb deleted file mode 100644 index b04fd4449845..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_capacity_commitments.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the list_capacity_commitments call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#list_capacity_commitments. -# -def list_capacity_commitments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new - - # Call the list_capacity_commitments method. - result = client.list_capacity_commitments request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - p item - end -end -# [END bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservation_groups.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservation_groups.rb deleted file mode 100644 index 473939033c10..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservation_groups.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_ListReservationGroups_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the list_reservation_groups call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#list_reservation_groups. -# -def list_reservation_groups - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest.new - - # Call the list_reservation_groups method. - result = client.list_reservation_groups request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup. - p item - end -end -# [END bigqueryreservation_v1_generated_ReservationService_ListReservationGroups_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservations.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservations.rb deleted file mode 100644 index 97d0f0dcb499..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservations.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_ListReservations_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the list_reservations call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#list_reservations. -# -def list_reservations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new - - # Call the list_reservations method. - result = client.list_reservations request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Reservation. - p item - end -end -# [END bigqueryreservation_v1_generated_ReservationService_ListReservations_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/merge_capacity_commitments.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/merge_capacity_commitments.rb deleted file mode 100644 index ed89db273627..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/merge_capacity_commitments.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the merge_capacity_commitments call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#merge_capacity_commitments. -# -def merge_capacity_commitments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new - - # Call the merge_capacity_commitments method. - result = client.merge_capacity_commitments request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/move_assignment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/move_assignment.rb deleted file mode 100644 index 83406d3ef306..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/move_assignment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_MoveAssignment_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the move_assignment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#move_assignment. -# -def move_assignment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new - - # Call the move_assignment method. - result = client.move_assignment request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_MoveAssignment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_all_assignments.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_all_assignments.rb deleted file mode 100644 index 5110e9672304..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_all_assignments.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the search_all_assignments call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#search_all_assignments. -# -def search_all_assignments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new - - # Call the search_all_assignments method. - result = client.search_all_assignments request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. - p item - end -end -# [END bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_assignments.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_assignments.rb deleted file mode 100644 index 7da77cab8f59..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_assignments.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_SearchAssignments_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the search_assignments call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#search_assignments. -# -def search_assignments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new - - # Call the search_assignments method. - result = client.search_assignments request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. - p item - end -end -# [END bigqueryreservation_v1_generated_ReservationService_SearchAssignments_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/set_iam_policy.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/set_iam_policy.rb deleted file mode 100644 index 4dc12130d309..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_SetIamPolicy_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the set_iam_policy call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/split_capacity_commitment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/split_capacity_commitment.rb deleted file mode 100644 index 888a9d9dbb8a..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/split_capacity_commitment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the split_capacity_commitment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#split_capacity_commitment. -# -def split_capacity_commitment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new - - # Call the split_capacity_commitment method. - result = client.split_capacity_commitment request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/test_iam_permissions.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/test_iam_permissions.rb deleted file mode 100644 index 2b711103c270..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_TestIamPermissions_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the test_iam_permissions call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_assignment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_assignment.rb deleted file mode 100644 index 5a0628a6de21..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_assignment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the update_assignment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#update_assignment. -# -def update_assignment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new - - # Call the update_assignment method. - result = client.update_assignment request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_bi_reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_bi_reservation.rb deleted file mode 100644 index 5d5266c844b8..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_bi_reservation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the update_bi_reservation call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#update_bi_reservation. -# -def update_bi_reservation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new - - # Call the update_bi_reservation method. - result = client.update_bi_reservation request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_capacity_commitment.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_capacity_commitment.rb deleted file mode 100644 index 1ec52bd3ddd3..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_capacity_commitment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the update_capacity_commitment call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#update_capacity_commitment. -# -def update_capacity_commitment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new - - # Call the update_capacity_commitment method. - result = client.update_capacity_commitment request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_reservation.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_reservation.rb deleted file mode 100644 index b3bc6f6648ac..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_reservation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START bigqueryreservation_v1_generated_ReservationService_UpdateReservation_sync] -require "google/cloud/bigquery/reservation/v1" - -## -# Snippet for the update_reservation call in the ReservationService 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::Bigquery::Reservation::V1::ReservationService::Client#update_reservation. -# -def update_reservation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new - - # Call the update_reservation method. - result = client.update_reservation request - - # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. - p result -end -# [END bigqueryreservation_v1_generated_ReservationService_UpdateReservation_sync] diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/snippet_metadata_google.cloud.bigquery.reservation.v1.json b/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/snippet_metadata_google.cloud.bigquery.reservation.v1.json deleted file mode 100644 index 9c975b868826..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/snippets/snippet_metadata_google.cloud.bigquery.reservation.v1.json +++ /dev/null @@ -1,1175 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-bigquery-reservation-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.bigquery.reservation.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_CreateReservation_sync", - "title": "Snippet for the create_reservation call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_reservation.", - "file": "reservation_service/create_reservation.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_reservation", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_reservation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::Reservation", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "CreateReservation", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_ListReservations_sync", - "title": "Snippet for the list_reservations call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservations.", - "file": "reservation_service/list_reservations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_reservations", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::ListReservationsResponse", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "ListReservations", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.ListReservations", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_GetReservation_sync", - "title": "Snippet for the get_reservation call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_reservation.", - "file": "reservation_service/get_reservation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_reservation", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_reservation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::Reservation", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "GetReservation", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.GetReservation", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_DeleteReservation_sync", - "title": "Snippet for the delete_reservation call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation.", - "file": "reservation_service/delete_reservation.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_reservation", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "DeleteReservation", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_UpdateReservation_sync", - "title": "Snippet for the update_reservation call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_reservation.", - "file": "reservation_service/update_reservation.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_reservation", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_reservation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::Reservation", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "UpdateReservation", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_FailoverReservation_sync", - "title": "Snippet for the failover_reservation call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#failover_reservation.", - "file": "reservation_service/failover_reservation.rb", - "language": "RUBY", - "client_method": { - "short_name": "failover_reservation", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#failover_reservation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::Reservation", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "FailoverReservation", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.FailoverReservation", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_sync", - "title": "Snippet for the create_capacity_commitment call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_capacity_commitment.", - "file": "reservation_service/create_capacity_commitment.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_capacity_commitment", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_capacity_commitment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "CreateCapacityCommitment", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_sync", - "title": "Snippet for the list_capacity_commitments call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_capacity_commitments.", - "file": "reservation_service/list_capacity_commitments.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_capacity_commitments", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_capacity_commitments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "ListCapacityCommitments", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_sync", - "title": "Snippet for the get_capacity_commitment call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_capacity_commitment.", - "file": "reservation_service/get_capacity_commitment.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_capacity_commitment", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_capacity_commitment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "GetCapacityCommitment", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_sync", - "title": "Snippet for the delete_capacity_commitment call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_capacity_commitment.", - "file": "reservation_service/delete_capacity_commitment.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_capacity_commitment", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_capacity_commitment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "DeleteCapacityCommitment", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_sync", - "title": "Snippet for the update_capacity_commitment call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_capacity_commitment.", - "file": "reservation_service/update_capacity_commitment.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_capacity_commitment", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_capacity_commitment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "UpdateCapacityCommitment", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_sync", - "title": "Snippet for the split_capacity_commitment call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#split_capacity_commitment.", - "file": "reservation_service/split_capacity_commitment.rb", - "language": "RUBY", - "client_method": { - "short_name": "split_capacity_commitment", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#split_capacity_commitment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "SplitCapacityCommitment", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_sync", - "title": "Snippet for the merge_capacity_commitments call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#merge_capacity_commitments.", - "file": "reservation_service/merge_capacity_commitments.rb", - "language": "RUBY", - "client_method": { - "short_name": "merge_capacity_commitments", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#merge_capacity_commitments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "MergeCapacityCommitments", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_CreateAssignment_sync", - "title": "Snippet for the create_assignment call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_assignment.", - "file": "reservation_service/create_assignment.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_assignment", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_assignment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::Assignment", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "CreateAssignment", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_ListAssignments_sync", - "title": "Snippet for the list_assignments call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_assignments.", - "file": "reservation_service/list_assignments.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_assignments", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_assignments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsResponse", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "ListAssignments", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_sync", - "title": "Snippet for the delete_assignment call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_assignment.", - "file": "reservation_service/delete_assignment.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_assignment", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_assignment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "DeleteAssignment", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_SearchAssignments_sync", - "title": "Snippet for the search_assignments call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_assignments.", - "file": "reservation_service/search_assignments.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_assignments", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_assignments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsResponse", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "SearchAssignments", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_sync", - "title": "Snippet for the search_all_assignments call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_all_assignments.", - "file": "reservation_service/search_all_assignments.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_all_assignments", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_all_assignments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsResponse", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "SearchAllAssignments", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_MoveAssignment_sync", - "title": "Snippet for the move_assignment call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#move_assignment.", - "file": "reservation_service/move_assignment.rb", - "language": "RUBY", - "client_method": { - "short_name": "move_assignment", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#move_assignment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::Assignment", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "MoveAssignment", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_sync", - "title": "Snippet for the update_assignment call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_assignment.", - "file": "reservation_service/update_assignment.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_assignment", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_assignment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::Assignment", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "UpdateAssignment", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignment", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_GetBiReservation_sync", - "title": "Snippet for the get_bi_reservation call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_bi_reservation.", - "file": "reservation_service/get_bi_reservation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_bi_reservation", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_bi_reservation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::BiReservation", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "GetBiReservation", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.GetBiReservation", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_sync", - "title": "Snippet for the update_bi_reservation call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_bi_reservation.", - "file": "reservation_service/update_bi_reservation.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_bi_reservation", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_bi_reservation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::BiReservation", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "UpdateBiReservation", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateBiReservation", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_iam_policy.", - "file": "reservation_service/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.GetIamPolicy", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#set_iam_policy.", - "file": "reservation_service/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.SetIamPolicy", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#test_iam_permissions.", - "file": "reservation_service/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.TestIamPermissions", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_CreateReservationGroup_sync", - "title": "Snippet for the create_reservation_group call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_reservation_group.", - "file": "reservation_service/create_reservation_group.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_reservation_group", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_reservation_group", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "CreateReservationGroup", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.CreateReservationGroup", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_GetReservationGroup_sync", - "title": "Snippet for the get_reservation_group call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_reservation_group.", - "file": "reservation_service/get_reservation_group.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_reservation_group", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_reservation_group", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "GetReservationGroup", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.GetReservationGroup", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_DeleteReservationGroup_sync", - "title": "Snippet for the delete_reservation_group call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation_group.", - "file": "reservation_service/delete_reservation_group.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_reservation_group", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation_group", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "DeleteReservationGroup", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservationGroup", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "bigqueryreservation_v1_generated_ReservationService_ListReservationGroups_sync", - "title": "Snippet for the list_reservation_groups call in the ReservationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservation_groups.", - "file": "reservation_service/list_reservation_groups.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_reservation_groups", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservation_groups", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsResponse", - "client": { - "short_name": "ReservationService::Client", - "full_name": "::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client" - }, - "method": { - "short_name": "ListReservationGroups", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService.ListReservationGroups", - "service": { - "short_name": "ReservationService", - "full_name": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_paths_test.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_paths_test.rb deleted file mode 100644 index 90254c913892..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_paths_test.rb +++ /dev/null @@ -1,115 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/bigquery/reservation/v1/reservation_service" - -class ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_assignment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.assignment_path project: "value0", location: "value1", reservation: "value2", assignment: "value3" - assert_equal "projects/value0/locations/value1/reservations/value2/assignments/value3", path - end - end - - def test_bi_reservation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.bi_reservation_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/biReservation", path - end - end - - def test_capacity_commitment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.capacity_commitment_path project: "value0", location: "value1", capacity_commitment: "value2" - assert_equal "projects/value0/locations/value1/capacityCommitments/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_reservation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.reservation_path project: "value0", location: "value1", reservation: "value2" - assert_equal "projects/value0/locations/value1/reservations/value2", path - end - end - - def test_reservation_group_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.reservation_group_path project: "value0", location: "value1", reservation_group: "value2" - assert_equal "projects/value0/locations/value1/reservationGroups/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_rest_test.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_rest_test.rb deleted file mode 100644 index 9b5d5402acc0..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_rest_test.rb +++ /dev/null @@ -1,1703 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/bigquery/reservation/v1/reservation_pb" -require "google/cloud/bigquery/reservation/v1/reservation_service/rest" - - -class ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_reservation - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - reservation_id = "hello world" - reservation = {} - - create_reservation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_create_reservation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_reservation_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_reservation({ parent: parent, reservation_id: reservation_id, reservation: reservation }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_reservation parent: parent, reservation_id: reservation_id, reservation: reservation do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_reservation ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new(parent: parent, reservation_id: reservation_id, reservation: reservation) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_reservation({ parent: parent, reservation_id: reservation_id, reservation: reservation }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_reservation(::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new(parent: parent, reservation_id: reservation_id, reservation: reservation), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_reservation_client_stub.call_count - end - end - end - - def test_list_reservations - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_reservations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_list_reservations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_reservations_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_reservations({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_reservations parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_reservations ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_reservations({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_reservations(::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_reservations_client_stub.call_count - end - end - end - - def test_get_reservation - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_reservation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_get_reservation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_reservation_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_reservation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_reservation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_reservation ::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_reservation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_reservation(::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_reservation_client_stub.call_count - end - end - end - - def test_delete_reservation - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_reservation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_delete_reservation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_reservation_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_reservation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_reservation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_reservation ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_reservation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_reservation(::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_reservation_client_stub.call_count - end - end - end - - def test_update_reservation - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - reservation = {} - update_mask = {} - - update_reservation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_update_reservation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_reservation_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_reservation({ reservation: reservation, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_reservation reservation: reservation, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_reservation ::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new(reservation: reservation, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_reservation({ reservation: reservation, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_reservation(::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new(reservation: reservation, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_reservation_client_stub.call_count - end - end - end - - def test_failover_reservation - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - failover_mode = :FAILOVER_MODE_UNSPECIFIED - - failover_reservation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_failover_reservation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, failover_reservation_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.failover_reservation({ name: name, failover_mode: failover_mode }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.failover_reservation name: name, failover_mode: failover_mode do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.failover_reservation ::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest.new(name: name, failover_mode: failover_mode) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.failover_reservation({ name: name, failover_mode: failover_mode }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.failover_reservation(::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest.new(name: name, failover_mode: failover_mode), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, failover_reservation_client_stub.call_count - end - end - end - - def test_create_capacity_commitment - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - capacity_commitment = {} - enforce_single_admin_project_per_org = true - capacity_commitment_id = "hello world" - - create_capacity_commitment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_create_capacity_commitment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_capacity_commitment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_capacity_commitment({ parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_capacity_commitment parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new(parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_capacity_commitment({ parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new(parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_capacity_commitment_client_stub.call_count - end - end - end - - def test_list_capacity_commitments - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_capacity_commitments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_list_capacity_commitments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_capacity_commitments_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_capacity_commitments({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_capacity_commitments parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_capacity_commitments ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_capacity_commitments({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_capacity_commitments(::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_capacity_commitments_client_stub.call_count - end - end - end - - def test_get_capacity_commitment - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_capacity_commitment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_get_capacity_commitment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_capacity_commitment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_capacity_commitment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_capacity_commitment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_capacity_commitment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_capacity_commitment_client_stub.call_count - end - end - end - - def test_delete_capacity_commitment - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - force = true - - delete_capacity_commitment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_delete_capacity_commitment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_capacity_commitment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_capacity_commitment({ name: name, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_capacity_commitment name: name, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new(name: name, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_capacity_commitment({ name: name, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new(name: name, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_capacity_commitment_client_stub.call_count - end - end - end - - def test_update_capacity_commitment - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - capacity_commitment = {} - update_mask = {} - - update_capacity_commitment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_update_capacity_commitment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_capacity_commitment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_capacity_commitment({ capacity_commitment: capacity_commitment, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_capacity_commitment capacity_commitment: capacity_commitment, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new(capacity_commitment: capacity_commitment, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_capacity_commitment({ capacity_commitment: capacity_commitment, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new(capacity_commitment: capacity_commitment, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_capacity_commitment_client_stub.call_count - end - end - end - - def test_split_capacity_commitment - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - slot_count = 42 - - split_capacity_commitment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_split_capacity_commitment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, split_capacity_commitment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.split_capacity_commitment({ name: name, slot_count: slot_count }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.split_capacity_commitment name: name, slot_count: slot_count do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.split_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new(name: name, slot_count: slot_count) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.split_capacity_commitment({ name: name, slot_count: slot_count }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.split_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new(name: name, slot_count: slot_count), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, split_capacity_commitment_client_stub.call_count - end - end - end - - def test_merge_capacity_commitments - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - capacity_commitment_ids = ["hello world"] - capacity_commitment_id = "hello world" - - merge_capacity_commitments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_merge_capacity_commitments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, merge_capacity_commitments_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.merge_capacity_commitments({ parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.merge_capacity_commitments parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.merge_capacity_commitments ::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new(parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.merge_capacity_commitments({ parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.merge_capacity_commitments(::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new(parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, merge_capacity_commitments_client_stub.call_count - end - end - end - - def test_create_assignment - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - assignment = {} - assignment_id = "hello world" - - create_assignment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_create_assignment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_assignment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_assignment({ parent: parent, assignment: assignment, assignment_id: assignment_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_assignment parent: parent, assignment: assignment, assignment_id: assignment_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_assignment ::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new(parent: parent, assignment: assignment, assignment_id: assignment_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_assignment({ parent: parent, assignment: assignment, assignment_id: assignment_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_assignment(::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new(parent: parent, assignment: assignment, assignment_id: assignment_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_assignment_client_stub.call_count - end - end - end - - def test_list_assignments - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_assignments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_list_assignments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_assignments_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_assignments({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_assignments parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_assignments ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_assignments({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_assignments(::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_assignments_client_stub.call_count - end - end - end - - def test_delete_assignment - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_assignment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_delete_assignment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_assignment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_assignment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_assignment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_assignment ::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_assignment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_assignment(::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_assignment_client_stub.call_count - end - end - end - - def test_search_assignments - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_assignments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_search_assignments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_assignments_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_assignments parent: parent, query: query, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_assignments ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_assignments(::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_assignments_client_stub.call_count - end - end - end - - def test_search_all_assignments - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_all_assignments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_search_all_assignments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_all_assignments_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_all_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_all_assignments parent: parent, query: query, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_all_assignments ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_all_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_all_assignments(::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_all_assignments_client_stub.call_count - end - end - end - - def test_move_assignment - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - destination_id = "hello world" - assignment_id = "hello world" - - move_assignment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_move_assignment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, move_assignment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.move_assignment({ name: name, destination_id: destination_id, assignment_id: assignment_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.move_assignment name: name, destination_id: destination_id, assignment_id: assignment_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.move_assignment ::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new(name: name, destination_id: destination_id, assignment_id: assignment_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.move_assignment({ name: name, destination_id: destination_id, assignment_id: assignment_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.move_assignment(::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new(name: name, destination_id: destination_id, assignment_id: assignment_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, move_assignment_client_stub.call_count - end - end - end - - def test_update_assignment - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - assignment = {} - update_mask = {} - - update_assignment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_update_assignment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_assignment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_assignment({ assignment: assignment, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_assignment assignment: assignment, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_assignment ::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new(assignment: assignment, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_assignment({ assignment: assignment, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_assignment(::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new(assignment: assignment, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_assignment_client_stub.call_count - end - end - end - - def test_get_bi_reservation - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::BiReservation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_bi_reservation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_get_bi_reservation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_bi_reservation_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_bi_reservation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_bi_reservation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_bi_reservation ::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_bi_reservation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_bi_reservation(::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_bi_reservation_client_stub.call_count - end - end - end - - def test_update_bi_reservation - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::BiReservation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - bi_reservation = {} - update_mask = {} - - update_bi_reservation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_update_bi_reservation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_bi_reservation_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_bi_reservation({ bi_reservation: bi_reservation, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_bi_reservation bi_reservation: bi_reservation, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_bi_reservation ::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new(bi_reservation: bi_reservation, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_bi_reservation({ bi_reservation: bi_reservation, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_bi_reservation(::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new(bi_reservation: bi_reservation, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_bi_reservation_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_create_reservation_group - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - reservation_group_id = "hello world" - reservation_group = {} - - create_reservation_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_create_reservation_group_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_reservation_group_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_reservation_group({ parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_reservation_group parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_reservation_group ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest.new(parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_reservation_group({ parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_reservation_group(::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest.new(parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_reservation_group_client_stub.call_count - end - end - end - - def test_get_reservation_group - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_reservation_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_get_reservation_group_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_reservation_group_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_reservation_group({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_reservation_group name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_reservation_group ::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_reservation_group({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_reservation_group(::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_reservation_group_client_stub.call_count - end - end - end - - def test_delete_reservation_group - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_reservation_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_delete_reservation_group_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_reservation_group_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_reservation_group({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_reservation_group name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_reservation_group ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_reservation_group({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_reservation_group(::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_reservation_group_client_stub.call_count - end - end - end - - def test_list_reservation_groups - # Create test objects. - client_result = ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_reservation_groups_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::ServiceStub.stub :transcode_list_reservation_groups_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_reservation_groups_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_reservation_groups({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_reservation_groups parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_reservation_groups ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_reservation_groups({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_reservation_groups(::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_reservation_groups_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::Bigquery::Reservation::V1::ReservationService::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::Bigquery::Reservation::V1::ReservationService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_test.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_test.rb deleted file mode 100644 index 0c4849ffddd6..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_test.rb +++ /dev/null @@ -1,1892 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/bigquery/reservation/v1/reservation_pb" -require "google/cloud/bigquery/reservation/v1/reservation_service" - -class ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_reservation - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - reservation_id = "hello world" - reservation = {} - - create_reservation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_reservation, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["reservation_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::Reservation), request["reservation"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_reservation_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_reservation({ parent: parent, reservation_id: reservation_id, reservation: reservation }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_reservation parent: parent, reservation_id: reservation_id, reservation: reservation do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_reservation ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new(parent: parent, reservation_id: reservation_id, reservation: reservation) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_reservation({ parent: parent, reservation_id: reservation_id, reservation: reservation }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_reservation(::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new(parent: parent, reservation_id: reservation_id, reservation: reservation), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_reservation_client_stub.call_rpc_count - end - end - - def test_list_reservations - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_reservations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_reservations, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_reservations_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_reservations({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_reservations parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_reservations ::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_reservations({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_reservations(::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_reservations_client_stub.call_rpc_count - end - end - - def test_get_reservation - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_reservation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_reservation, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_reservation_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_reservation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_reservation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_reservation ::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_reservation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_reservation(::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_reservation_client_stub.call_rpc_count - end - end - - def test_delete_reservation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_reservation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_reservation, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_reservation_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_reservation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_reservation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_reservation ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_reservation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_reservation(::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_reservation_client_stub.call_rpc_count - end - end - - def test_update_reservation - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.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. - reservation = {} - update_mask = {} - - update_reservation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_reservation, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::Reservation), request["reservation"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_reservation_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_reservation({ reservation: reservation, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_reservation reservation: reservation, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_reservation ::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new(reservation: reservation, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_reservation({ reservation: reservation, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_reservation(::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new(reservation: reservation, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_reservation_client_stub.call_rpc_count - end - end - - def test_failover_reservation - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::Reservation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - failover_mode = :FAILOVER_MODE_UNSPECIFIED - - failover_reservation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :failover_reservation, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest, request - assert_equal "hello world", request["name"] - assert_equal :FAILOVER_MODE_UNSPECIFIED, request["failover_mode"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, failover_reservation_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.failover_reservation({ name: name, failover_mode: failover_mode }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.failover_reservation name: name, failover_mode: failover_mode do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.failover_reservation ::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest.new(name: name, failover_mode: failover_mode) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.failover_reservation({ name: name, failover_mode: failover_mode }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.failover_reservation(::Google::Cloud::Bigquery::Reservation::V1::FailoverReservationRequest.new(name: name, failover_mode: failover_mode), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, failover_reservation_client_stub.call_rpc_count - end - end - - def test_create_capacity_commitment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - capacity_commitment = {} - enforce_single_admin_project_per_org = true - capacity_commitment_id = "hello world" - - create_capacity_commitment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_capacity_commitment, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment), request["capacity_commitment"] - assert_equal true, request["enforce_single_admin_project_per_org"] - assert_equal "hello world", request["capacity_commitment_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_capacity_commitment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_capacity_commitment({ parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_capacity_commitment parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new(parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_capacity_commitment({ parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new(parent: parent, capacity_commitment: capacity_commitment, enforce_single_admin_project_per_org: enforce_single_admin_project_per_org, capacity_commitment_id: capacity_commitment_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_capacity_commitment_client_stub.call_rpc_count - end - end - - def test_list_capacity_commitments - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_capacity_commitments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_capacity_commitments, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_capacity_commitments_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_capacity_commitments({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_capacity_commitments parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_capacity_commitments ::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_capacity_commitments({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_capacity_commitments(::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_capacity_commitments_client_stub.call_rpc_count - end - end - - def test_get_capacity_commitment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_capacity_commitment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_capacity_commitment, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_capacity_commitment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_capacity_commitment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_capacity_commitment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_capacity_commitment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_capacity_commitment_client_stub.call_rpc_count - end - end - - def test_delete_capacity_commitment - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - force = true - - delete_capacity_commitment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_capacity_commitment, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_capacity_commitment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_capacity_commitment({ name: name, force: force }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_capacity_commitment name: name, force: force do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new(name: name, force: force) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_capacity_commitment({ name: name, force: force }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new(name: name, force: force), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_capacity_commitment_client_stub.call_rpc_count - end - end - - def test_update_capacity_commitment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.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. - capacity_commitment = {} - update_mask = {} - - update_capacity_commitment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_capacity_commitment, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment), request["capacity_commitment"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_capacity_commitment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_capacity_commitment({ capacity_commitment: capacity_commitment, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_capacity_commitment capacity_commitment: capacity_commitment, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new(capacity_commitment: capacity_commitment, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_capacity_commitment({ capacity_commitment: capacity_commitment, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new(capacity_commitment: capacity_commitment, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_capacity_commitment_client_stub.call_rpc_count - end - end - - def test_split_capacity_commitment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - slot_count = 42 - - split_capacity_commitment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :split_capacity_commitment, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["slot_count"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, split_capacity_commitment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.split_capacity_commitment({ name: name, slot_count: slot_count }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.split_capacity_commitment name: name, slot_count: slot_count do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.split_capacity_commitment ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new(name: name, slot_count: slot_count) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.split_capacity_commitment({ name: name, slot_count: slot_count }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.split_capacity_commitment(::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new(name: name, slot_count: slot_count), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, split_capacity_commitment_client_stub.call_rpc_count - end - end - - def test_merge_capacity_commitments - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - capacity_commitment_ids = ["hello world"] - capacity_commitment_id = "hello world" - - merge_capacity_commitments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :merge_capacity_commitments, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest, request - assert_equal "hello world", request["parent"] - assert_equal ["hello world"], request["capacity_commitment_ids"] - assert_equal "hello world", request["capacity_commitment_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, merge_capacity_commitments_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.merge_capacity_commitments({ parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.merge_capacity_commitments parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.merge_capacity_commitments ::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new(parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.merge_capacity_commitments({ parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.merge_capacity_commitments(::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new(parent: parent, capacity_commitment_ids: capacity_commitment_ids, capacity_commitment_id: capacity_commitment_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, merge_capacity_commitments_client_stub.call_rpc_count - end - end - - def test_create_assignment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - assignment = {} - assignment_id = "hello world" - - create_assignment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_assignment, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::Assignment), request["assignment"] - assert_equal "hello world", request["assignment_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_assignment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_assignment({ parent: parent, assignment: assignment, assignment_id: assignment_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_assignment parent: parent, assignment: assignment, assignment_id: assignment_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_assignment ::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new(parent: parent, assignment: assignment, assignment_id: assignment_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_assignment({ parent: parent, assignment: assignment, assignment_id: assignment_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_assignment(::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new(parent: parent, assignment: assignment, assignment_id: assignment_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_assignment_client_stub.call_rpc_count - end - end - - def test_list_assignments - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_assignments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_assignments, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_assignments_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_assignments({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_assignments parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_assignments ::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_assignments({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_assignments(::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_assignments_client_stub.call_rpc_count - end - end - - def test_delete_assignment - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_assignment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_assignment, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_assignment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_assignment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_assignment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_assignment ::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_assignment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_assignment(::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_assignment_client_stub.call_rpc_count - end - end - - def test_search_assignments - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_assignments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_assignments, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["query"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_assignments_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_assignments parent: parent, query: query, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_assignments ::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_assignments(::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_assignments_client_stub.call_rpc_count - end - end - - def test_search_all_assignments - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_all_assignments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_all_assignments, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["query"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_all_assignments_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_all_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_all_assignments parent: parent, query: query, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_all_assignments ::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_all_assignments({ parent: parent, query: query, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_all_assignments(::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new(parent: parent, query: query, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_all_assignments_client_stub.call_rpc_count - end - end - - def test_move_assignment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - destination_id = "hello world" - assignment_id = "hello world" - - move_assignment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :move_assignment, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["destination_id"] - assert_equal "hello world", request["assignment_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, move_assignment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.move_assignment({ name: name, destination_id: destination_id, assignment_id: assignment_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.move_assignment name: name, destination_id: destination_id, assignment_id: assignment_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.move_assignment ::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new(name: name, destination_id: destination_id, assignment_id: assignment_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.move_assignment({ name: name, destination_id: destination_id, assignment_id: assignment_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.move_assignment(::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new(name: name, destination_id: destination_id, assignment_id: assignment_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, move_assignment_client_stub.call_rpc_count - end - end - - def test_update_assignment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::Assignment.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. - assignment = {} - update_mask = {} - - update_assignment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_assignment, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::Assignment), request["assignment"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_assignment_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_assignment({ assignment: assignment, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_assignment assignment: assignment, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_assignment ::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new(assignment: assignment, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_assignment({ assignment: assignment, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_assignment(::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new(assignment: assignment, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_assignment_client_stub.call_rpc_count - end - end - - def test_get_bi_reservation - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::BiReservation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_bi_reservation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_bi_reservation, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_bi_reservation_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_bi_reservation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_bi_reservation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_bi_reservation ::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_bi_reservation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_bi_reservation(::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_bi_reservation_client_stub.call_rpc_count - end - end - - def test_update_bi_reservation - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::BiReservation.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. - bi_reservation = {} - update_mask = {} - - update_bi_reservation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_bi_reservation, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::BiReservation), request["bi_reservation"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_bi_reservation_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_bi_reservation({ bi_reservation: bi_reservation, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_bi_reservation bi_reservation: bi_reservation, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_bi_reservation ::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new(bi_reservation: bi_reservation, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_bi_reservation({ bi_reservation: bi_reservation, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_bi_reservation(::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new(bi_reservation: bi_reservation, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_bi_reservation_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_create_reservation_group - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - reservation_group_id = "hello world" - reservation_group = {} - - create_reservation_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_reservation_group, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["reservation_group_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup), request["reservation_group"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_reservation_group_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_reservation_group({ parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_reservation_group parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_reservation_group ::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest.new(parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_reservation_group({ parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_reservation_group(::Google::Cloud::Bigquery::Reservation::V1::CreateReservationGroupRequest.new(parent: parent, reservation_group_id: reservation_group_id, reservation_group: reservation_group), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_reservation_group_client_stub.call_rpc_count - end - end - - def test_get_reservation_group - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::ReservationGroup.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_reservation_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_reservation_group, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_reservation_group_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_reservation_group({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_reservation_group name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_reservation_group ::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_reservation_group({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_reservation_group(::Google::Cloud::Bigquery::Reservation::V1::GetReservationGroupRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_reservation_group_client_stub.call_rpc_count - end - end - - def test_delete_reservation_group - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_reservation_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_reservation_group, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_reservation_group_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_reservation_group({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_reservation_group name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_reservation_group ::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_reservation_group({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_reservation_group(::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationGroupRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_reservation_group_client_stub.call_rpc_count - end - end - - def test_list_reservation_groups - # Create GRPC objects. - grpc_response = ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_reservation_groups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_reservation_groups, name - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_reservation_groups_client_stub do - # Create client - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_reservation_groups({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_reservation_groups parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_reservation_groups ::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_reservation_groups({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_reservation_groups(::Google::Cloud::Bigquery::Reservation::V1::ListReservationGroupsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_reservation_groups_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::Bigquery::Reservation::V1::ReservationService::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::Bigquery::Reservation::V1::ReservationService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/helper.rb b/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/helper.rb deleted file mode 100644 index 968201e8049d..000000000000 --- a/owl-bot-staging/google-cloud-bigquery-reservation-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"