From f30739d2fbc1567f648f4cb7a774aad760f3b07d Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 25 Apr 2026 01:02:46 +0000 Subject: [PATCH 1/2] feat: Update Compute Engine v1 API to revision 20260331 Source-Link: https://github.com/googleapis/googleapis/commit/8d5e50ea70bd85220ab7fcc5931b329ef679725c Source-Link: https://github.com/googleapis/googleapis-gen/commit/1ee38c336433be76e6b82eab789cdd00193508b5 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWNvbXB1dGUvLk93bEJvdC55YW1sIiwiaCI6IjFlZTM4YzMzNjQzM2JlNzZlNmI4MmVhYjc4OWNkZDAwMTkzNTA4YjUifQ== --- .../google-cloud-compute/.gitignore | 22 + .../google-cloud-compute/.repo-metadata.json | 18 + .../google-cloud-compute/.rubocop.yml | 39 + owl-bot-staging/google-cloud-compute/.toys.rb | 28 + .../google-cloud-compute/.yardopts | 11 + .../google-cloud-compute/AUTHENTICATION.md | 122 + .../google-cloud-compute/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-compute/Gemfile | 31 + .../google-cloud-compute/LICENSE.md | 201 + .../google-cloud-compute/README.md | 142 + owl-bot-staging/google-cloud-compute/Rakefile | 169 + .../google-cloud-compute.gemspec | 27 + .../lib/google-cloud-compute.rb | 19 + .../lib/google/cloud/compute.rb | 7645 +++++++++++++++++ .../lib/google/cloud/compute/version.rb | 26 + .../test/google/cloud/compute/client_test.rb | 1242 +++ .../test/google/cloud/compute/version_test.rb | 26 + .../google-cloud-compute/test/helper.rb | 26 + 18 files changed, 9796 insertions(+) create mode 100644 owl-bot-staging/google-cloud-compute/.gitignore create mode 100644 owl-bot-staging/google-cloud-compute/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-compute/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-compute/.toys.rb create mode 100644 owl-bot-staging/google-cloud-compute/.yardopts create mode 100644 owl-bot-staging/google-cloud-compute/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-compute/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-compute/Gemfile create mode 100644 owl-bot-staging/google-cloud-compute/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-compute/README.md create mode 100644 owl-bot-staging/google-cloud-compute/Rakefile create mode 100644 owl-bot-staging/google-cloud-compute/google-cloud-compute.gemspec create mode 100644 owl-bot-staging/google-cloud-compute/lib/google-cloud-compute.rb create mode 100644 owl-bot-staging/google-cloud-compute/lib/google/cloud/compute.rb create mode 100644 owl-bot-staging/google-cloud-compute/lib/google/cloud/compute/version.rb create mode 100644 owl-bot-staging/google-cloud-compute/test/google/cloud/compute/client_test.rb create mode 100644 owl-bot-staging/google-cloud-compute/test/google/cloud/compute/version_test.rb create mode 100644 owl-bot-staging/google-cloud-compute/test/helper.rb diff --git a/owl-bot-staging/google-cloud-compute/.gitignore b/owl-bot-staging/google-cloud-compute/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/.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-compute/.repo-metadata.json b/owl-bot-staging/google-cloud-compute/.repo-metadata.json new file mode 100644 index 000000000000..3070ce18f1a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "compute.googleapis.com", + "api_shortname": "compute", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-compute/latest", + "distribution_name": "google-cloud-compute", + "is_cloud": true, + "language": "ruby", + "name": "compute", + "name_pretty": "Google Cloud Compute API", + "product_documentation": "https://cloud.google.com/compute/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "google-cloud-compute is the official client library for the Google Cloud Compute API.", + "ruby-cloud-env-prefix": "COMPUTE", + "ruby-cloud-product-url": "https://cloud.google.com/compute/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-compute/.rubocop.yml b/owl-bot-staging/google-cloud-compute/.rubocop.yml new file mode 100644 index 000000000000..ce239dc46710 --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-compute.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-compute.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-compute/.toys.rb b/owl-bot-staging/google-cloud-compute/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-compute/.yardopts b/owl-bot-staging/google-cloud-compute/.yardopts new file mode 100644 index 000000000000..2207b657d0dd --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Google Cloud Compute API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-compute/AUTHENTICATION.md b/owl-bot-staging/google-cloud-compute/AUTHENTICATION.md new file mode 100644 index 000000000000..0933f5e25695 --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-compute 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-compute 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/compute" + +client = Google::Cloud::Compute.accelerator_types do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/compute" + +Google::Cloud::Compute.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::Compute.accelerator_types +``` + +### 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-compute +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/compute" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::Compute.accelerator_types +``` + +### 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-compute/CHANGELOG.md b/owl-bot-staging/google-cloud-compute/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-compute/Gemfile b/owl-bot-staging/google-cloud-compute/Gemfile new file mode 100644 index 000000000000..23ff6506a8a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/Gemfile @@ -0,0 +1,31 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-compute-v1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-compute.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-compute/LICENSE.md b/owl-bot-staging/google-cloud-compute/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/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-compute/README.md b/owl-bot-staging/google-cloud-compute/README.md new file mode 100644 index 000000000000..99c7a733ef5a --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Google Cloud Compute API + +API Client library for the Google Cloud Compute API + +google-cloud-compute is the official client library for the Google Cloud Compute API. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-compute-v*`. +The gem `google-cloud-compute` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-compute/latest) +for this library, google-cloud-compute, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-compute-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/compute/) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-compute +``` + +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/compute.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/compute" + +client = Google::Cloud::Compute.accelerator_types +request = ::Google::Cloud::Compute::V1::AggregatedListAcceleratorTypesRequest.new # (request fields as keyword arguments...) +response = client.aggregated_list request +``` + +## 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. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-compute-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest). + +## 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-compute`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-compute-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-compute`. +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-compute-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-compute/Rakefile b/owl-bot-staging/google-cloud-compute/Rakefile new file mode 100644 index 000000000000..39e754c29855 --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = true +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-compute acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["COMPUTE_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["COMPUTE_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["COMPUTE_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 COMPUTE_TEST_PROJECT=test123 COMPUTE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/compute/v1/accelerator_types/credentials" + ::Google::Cloud::Compute::V1::AcceleratorTypes::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["COMPUTE_PROJECT"] = project + ENV["COMPUTE_TEST_PROJECT"] = project + ENV["COMPUTE_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-compute 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-compute 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-compute 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-compute gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-compute" + header "google-cloud-compute rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-compute yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-compute 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-compute 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-compute 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-compute/google-cloud-compute.gemspec b/owl-bot-staging/google-cloud-compute/google-cloud-compute.gemspec new file mode 100644 index 000000000000..7fcccd83f78f --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/google-cloud-compute.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/compute/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-compute" + gem.version = Google::Cloud::Compute::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "google-cloud-compute is the official client library for the Google Cloud Compute API." + gem.summary = "API Client library for the Google Cloud Compute API" + 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.2" + + gem.add_dependency "google-cloud-compute-v1", "~> 2.15" + gem.add_dependency "google-cloud-core", "~> 1.6" +end diff --git a/owl-bot-staging/google-cloud-compute/lib/google-cloud-compute.rb b/owl-bot-staging/google-cloud-compute/lib/google-cloud-compute.rb new file mode 100644 index 000000000000..5517c8d57dd6 --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/lib/google-cloud-compute.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/compute" unless defined? Google::Cloud::Compute::VERSION diff --git a/owl-bot-staging/google-cloud-compute/lib/google/cloud/compute.rb b/owl-bot-staging/google-cloud-compute/lib/google/cloud/compute.rb new file mode 100644 index 000000000000..c1ba12539164 --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/lib/google/cloud/compute.rb @@ -0,0 +1,7645 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# Require this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/compute/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :compute do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module Compute + ## + # Create a new client object for AcceleratorTypes. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::AcceleratorTypes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-AcceleratorTypes-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the AcceleratorTypes service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the AcceleratorTypes service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.accelerator_types_available?}. + # + # ## About AcceleratorTypes + # + # Services + # + # The AcceleratorTypes API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.accelerator_types version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:AcceleratorTypes) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the AcceleratorTypes service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.accelerator_types}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the AcceleratorTypes service, + # or if the versioned client gem needs an update to support the AcceleratorTypes service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.accelerator_types_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :AcceleratorTypes + service_module = service_module.const_get :AcceleratorTypes + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Addresses. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Addresses::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Addresses-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Addresses service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Addresses service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.addresses_available?}. + # + # ## About Addresses + # + # The Addresses API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.addresses version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Addresses) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Addresses service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.addresses}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Addresses service, + # or if the versioned client gem needs an update to support the Addresses service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.addresses_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Addresses + service_module = service_module.const_get :Addresses + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Advice. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Advice::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Advice-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Advice service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Advice service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.advice_available?}. + # + # ## About Advice + # + # The Advice API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.advice version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Advice) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Advice service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.advice}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Advice service, + # or if the versioned client gem needs an update to support the Advice service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.advice_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Advice + service_module = service_module.const_get :Advice + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Autoscalers. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Autoscalers::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Autoscalers-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Autoscalers service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Autoscalers service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.autoscalers_available?}. + # + # ## About Autoscalers + # + # The Autoscalers API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.autoscalers version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Autoscalers) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Autoscalers service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.autoscalers}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Autoscalers service, + # or if the versioned client gem needs an update to support the Autoscalers service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.autoscalers_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Autoscalers + service_module = service_module.const_get :Autoscalers + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for BackendBuckets. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::BackendBuckets::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-BackendBuckets-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the BackendBuckets service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the BackendBuckets service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.backend_buckets_available?}. + # + # ## About BackendBuckets + # + # The BackendBuckets API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.backend_buckets version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:BackendBuckets) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the BackendBuckets service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.backend_buckets}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the BackendBuckets service, + # or if the versioned client gem needs an update to support the BackendBuckets service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.backend_buckets_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :BackendBuckets + service_module = service_module.const_get :BackendBuckets + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for BackendServices. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::BackendServices::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-BackendServices-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the BackendServices service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the BackendServices service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.backend_services_available?}. + # + # ## About BackendServices + # + # The BackendServices API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.backend_services version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:BackendServices) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the BackendServices service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.backend_services}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the BackendServices service, + # or if the versioned client gem needs an update to support the BackendServices service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.backend_services_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :BackendServices + service_module = service_module.const_get :BackendServices + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for CrossSiteNetworks. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::CrossSiteNetworks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-CrossSiteNetworks-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the CrossSiteNetworks service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the CrossSiteNetworks service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.cross_site_networks_available?}. + # + # ## About CrossSiteNetworks + # + # The CrossSiteNetworks API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.cross_site_networks version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:CrossSiteNetworks) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the CrossSiteNetworks service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.cross_site_networks}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the CrossSiteNetworks service, + # or if the versioned client gem needs an update to support the CrossSiteNetworks service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.cross_site_networks_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :CrossSiteNetworks + service_module = service_module.const_get :CrossSiteNetworks + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for DiskTypes. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::DiskTypes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-DiskTypes-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the DiskTypes service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the DiskTypes service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.disk_types_available?}. + # + # ## About DiskTypes + # + # The DiskTypes API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.disk_types version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:DiskTypes) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the DiskTypes service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.disk_types}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the DiskTypes service, + # or if the versioned client gem needs an update to support the DiskTypes service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.disk_types_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :DiskTypes + service_module = service_module.const_get :DiskTypes + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Disks. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Disks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Disks-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Disks service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Disks service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.disks_available?}. + # + # ## About Disks + # + # The Disks API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.disks version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Disks) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Disks service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.disks}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Disks service, + # or if the versioned client gem needs an update to support the Disks service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.disks_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Disks + service_module = service_module.const_get :Disks + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ExternalVpnGateways. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::ExternalVpnGateways::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ExternalVpnGateways-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ExternalVpnGateways service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the ExternalVpnGateways service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.external_vpn_gateways_available?}. + # + # ## About ExternalVpnGateways + # + # The ExternalVpnGateways API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.external_vpn_gateways version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ExternalVpnGateways) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the ExternalVpnGateways service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.external_vpn_gateways}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ExternalVpnGateways service, + # or if the versioned client gem needs an update to support the ExternalVpnGateways service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.external_vpn_gateways_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :ExternalVpnGateways + service_module = service_module.const_get :ExternalVpnGateways + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for FirewallPolicies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::FirewallPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-FirewallPolicies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the FirewallPolicies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the FirewallPolicies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.firewall_policies_available?}. + # + # ## About FirewallPolicies + # + # The FirewallPolicies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.firewall_policies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:FirewallPolicies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the FirewallPolicies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.firewall_policies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the FirewallPolicies service, + # or if the versioned client gem needs an update to support the FirewallPolicies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.firewall_policies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :FirewallPolicies + service_module = service_module.const_get :FirewallPolicies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Firewalls. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Firewalls::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Firewalls-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Firewalls service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Firewalls service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.firewalls_available?}. + # + # ## About Firewalls + # + # The Firewalls API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.firewalls version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Firewalls) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Firewalls service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.firewalls}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Firewalls service, + # or if the versioned client gem needs an update to support the Firewalls service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.firewalls_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Firewalls + service_module = service_module.const_get :Firewalls + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ForwardingRules. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::ForwardingRules::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ForwardingRules-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ForwardingRules service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the ForwardingRules service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.forwarding_rules_available?}. + # + # ## About ForwardingRules + # + # The ForwardingRules API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.forwarding_rules version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ForwardingRules) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the ForwardingRules service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.forwarding_rules}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ForwardingRules service, + # or if the versioned client gem needs an update to support the ForwardingRules service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.forwarding_rules_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :ForwardingRules + service_module = service_module.const_get :ForwardingRules + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for FutureReservations. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::FutureReservations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-FutureReservations-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the FutureReservations service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the FutureReservations service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.future_reservations_available?}. + # + # ## About FutureReservations + # + # The FutureReservations API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.future_reservations version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:FutureReservations) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the FutureReservations service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.future_reservations}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the FutureReservations service, + # or if the versioned client gem needs an update to support the FutureReservations service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.future_reservations_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :FutureReservations + service_module = service_module.const_get :FutureReservations + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for GlobalAddresses. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::GlobalAddresses::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-GlobalAddresses-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the GlobalAddresses service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the GlobalAddresses service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.global_addresses_available?}. + # + # ## About GlobalAddresses + # + # The GlobalAddresses API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.global_addresses version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:GlobalAddresses) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the GlobalAddresses service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.global_addresses}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the GlobalAddresses service, + # or if the versioned client gem needs an update to support the GlobalAddresses service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.global_addresses_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :GlobalAddresses + service_module = service_module.const_get :GlobalAddresses + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for GlobalForwardingRules. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::GlobalForwardingRules::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-GlobalForwardingRules-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the GlobalForwardingRules service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the GlobalForwardingRules service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.global_forwarding_rules_available?}. + # + # ## About GlobalForwardingRules + # + # The GlobalForwardingRules API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.global_forwarding_rules version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:GlobalForwardingRules) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the GlobalForwardingRules service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.global_forwarding_rules}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the GlobalForwardingRules service, + # or if the versioned client gem needs an update to support the GlobalForwardingRules service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.global_forwarding_rules_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :GlobalForwardingRules + service_module = service_module.const_get :GlobalForwardingRules + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for GlobalNetworkEndpointGroups. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::GlobalNetworkEndpointGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-GlobalNetworkEndpointGroups-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the GlobalNetworkEndpointGroups service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the GlobalNetworkEndpointGroups service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.global_network_endpoint_groups_available?}. + # + # ## About GlobalNetworkEndpointGroups + # + # The GlobalNetworkEndpointGroups API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.global_network_endpoint_groups version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:GlobalNetworkEndpointGroups) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the GlobalNetworkEndpointGroups service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.global_network_endpoint_groups}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the GlobalNetworkEndpointGroups service, + # or if the versioned client gem needs an update to support the GlobalNetworkEndpointGroups service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.global_network_endpoint_groups_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :GlobalNetworkEndpointGroups + service_module = service_module.const_get :GlobalNetworkEndpointGroups + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for GlobalOperations. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::GlobalOperations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-GlobalOperations-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the GlobalOperations service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the GlobalOperations service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.global_operations_available?}. + # + # ## About GlobalOperations + # + # The GlobalOperations API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.global_operations version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:GlobalOperations) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the GlobalOperations service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.global_operations}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the GlobalOperations service, + # or if the versioned client gem needs an update to support the GlobalOperations service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.global_operations_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :GlobalOperations + service_module = service_module.const_get :GlobalOperations + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for GlobalOrganizationOperations. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-GlobalOrganizationOperations-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the GlobalOrganizationOperations service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the GlobalOrganizationOperations service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.global_organization_operations_available?}. + # + # ## About GlobalOrganizationOperations + # + # The GlobalOrganizationOperations API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.global_organization_operations version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:GlobalOrganizationOperations) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the GlobalOrganizationOperations service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.global_organization_operations}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the GlobalOrganizationOperations service, + # or if the versioned client gem needs an update to support the GlobalOrganizationOperations service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.global_organization_operations_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :GlobalOrganizationOperations + service_module = service_module.const_get :GlobalOrganizationOperations + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for GlobalPublicDelegatedPrefixes. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::GlobalPublicDelegatedPrefixes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-GlobalPublicDelegatedPrefixes-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the GlobalPublicDelegatedPrefixes service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the GlobalPublicDelegatedPrefixes service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.global_public_delegated_prefixes_available?}. + # + # ## About GlobalPublicDelegatedPrefixes + # + # The GlobalPublicDelegatedPrefixes API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.global_public_delegated_prefixes version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:GlobalPublicDelegatedPrefixes) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the GlobalPublicDelegatedPrefixes service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.global_public_delegated_prefixes}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the GlobalPublicDelegatedPrefixes service, + # or if the versioned client gem needs an update to support the GlobalPublicDelegatedPrefixes service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.global_public_delegated_prefixes_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :GlobalPublicDelegatedPrefixes + service_module = service_module.const_get :GlobalPublicDelegatedPrefixes + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for HealthChecks. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::HealthChecks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-HealthChecks-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the HealthChecks service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the HealthChecks service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.health_checks_available?}. + # + # ## About HealthChecks + # + # The HealthChecks API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.health_checks version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:HealthChecks) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the HealthChecks service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.health_checks}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the HealthChecks service, + # or if the versioned client gem needs an update to support the HealthChecks service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.health_checks_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :HealthChecks + service_module = service_module.const_get :HealthChecks + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ImageFamilyViews. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::ImageFamilyViews::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ImageFamilyViews-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ImageFamilyViews service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the ImageFamilyViews service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.image_family_views_available?}. + # + # ## About ImageFamilyViews + # + # The ImageFamilyViews API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.image_family_views version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ImageFamilyViews) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the ImageFamilyViews service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.image_family_views}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ImageFamilyViews service, + # or if the versioned client gem needs an update to support the ImageFamilyViews service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.image_family_views_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :ImageFamilyViews + service_module = service_module.const_get :ImageFamilyViews + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Images. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Images::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Images-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Images service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Images service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.images_available?}. + # + # ## About Images + # + # The Images API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.images version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Images) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Images service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.images}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Images service, + # or if the versioned client gem needs an update to support the Images service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.images_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Images + service_module = service_module.const_get :Images + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for InstanceGroupManagerResizeRequests. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InstanceGroupManagerResizeRequests-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the InstanceGroupManagerResizeRequests service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the InstanceGroupManagerResizeRequests service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.instance_group_manager_resize_requests_available?}. + # + # ## About InstanceGroupManagerResizeRequests + # + # The InstanceGroupManagerResizeRequests API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.instance_group_manager_resize_requests version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InstanceGroupManagerResizeRequests) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the InstanceGroupManagerResizeRequests service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instance_group_manager_resize_requests}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the InstanceGroupManagerResizeRequests service, + # or if the versioned client gem needs an update to support the InstanceGroupManagerResizeRequests service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.instance_group_manager_resize_requests_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :InstanceGroupManagerResizeRequests + service_module = service_module.const_get :InstanceGroupManagerResizeRequests + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for InstanceGroupManagers. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InstanceGroupManagers-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the InstanceGroupManagers service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the InstanceGroupManagers service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.instance_group_managers_available?}. + # + # ## About InstanceGroupManagers + # + # The InstanceGroupManagers API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.instance_group_managers version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InstanceGroupManagers) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the InstanceGroupManagers service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instance_group_managers}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the InstanceGroupManagers service, + # or if the versioned client gem needs an update to support the InstanceGroupManagers service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.instance_group_managers_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :InstanceGroupManagers + service_module = service_module.const_get :InstanceGroupManagers + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for InstanceGroups. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::InstanceGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InstanceGroups-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the InstanceGroups service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the InstanceGroups service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.instance_groups_available?}. + # + # ## About InstanceGroups + # + # The InstanceGroups API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.instance_groups version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InstanceGroups) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the InstanceGroups service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instance_groups}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the InstanceGroups service, + # or if the versioned client gem needs an update to support the InstanceGroups service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.instance_groups_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :InstanceGroups + service_module = service_module.const_get :InstanceGroups + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for InstanceSettingsService. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::InstanceSettingsService::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InstanceSettingsService-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the InstanceSettingsService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the InstanceSettingsService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.instance_settings_service_available?}. + # + # ## About InstanceSettingsService + # + # The InstanceSettings API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.instance_settings_service version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InstanceSettingsService) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the InstanceSettingsService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instance_settings_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the InstanceSettingsService service, + # or if the versioned client gem needs an update to support the InstanceSettingsService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.instance_settings_service_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :InstanceSettingsService + service_module = service_module.const_get :InstanceSettingsService + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for InstanceTemplates. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::InstanceTemplates::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InstanceTemplates-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the InstanceTemplates service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the InstanceTemplates service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.instance_templates_available?}. + # + # ## About InstanceTemplates + # + # The InstanceTemplates API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.instance_templates version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InstanceTemplates) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the InstanceTemplates service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instance_templates}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the InstanceTemplates service, + # or if the versioned client gem needs an update to support the InstanceTemplates service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.instance_templates_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :InstanceTemplates + service_module = service_module.const_get :InstanceTemplates + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Instances. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Instances::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Instances-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Instances service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Instances service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.instances_available?}. + # + # ## About Instances + # + # The Instances API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.instances version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Instances) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Instances service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instances}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Instances service, + # or if the versioned client gem needs an update to support the Instances service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.instances_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Instances + service_module = service_module.const_get :Instances + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for InstantSnapshotGroups. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::InstantSnapshotGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InstantSnapshotGroups-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the InstantSnapshotGroups service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the InstantSnapshotGroups service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.instant_snapshot_groups_available?}. + # + # ## About InstantSnapshotGroups + # + # The InstantSnapshotGroups API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.instant_snapshot_groups version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InstantSnapshotGroups) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the InstantSnapshotGroups service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instant_snapshot_groups}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the InstantSnapshotGroups service, + # or if the versioned client gem needs an update to support the InstantSnapshotGroups service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.instant_snapshot_groups_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :InstantSnapshotGroups + service_module = service_module.const_get :InstantSnapshotGroups + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for InstantSnapshots. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::InstantSnapshots::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InstantSnapshots-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the InstantSnapshots service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the InstantSnapshots service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.instant_snapshots_available?}. + # + # ## About InstantSnapshots + # + # The InstantSnapshots API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.instant_snapshots version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InstantSnapshots) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the InstantSnapshots service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instant_snapshots}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the InstantSnapshots service, + # or if the versioned client gem needs an update to support the InstantSnapshots service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.instant_snapshots_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :InstantSnapshots + service_module = service_module.const_get :InstantSnapshots + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for InterconnectAttachmentGroups. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InterconnectAttachmentGroups-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the InterconnectAttachmentGroups service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the InterconnectAttachmentGroups service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.interconnect_attachment_groups_available?}. + # + # ## About InterconnectAttachmentGroups + # + # The InterconnectAttachmentGroups API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.interconnect_attachment_groups version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InterconnectAttachmentGroups) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the InterconnectAttachmentGroups service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.interconnect_attachment_groups}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the InterconnectAttachmentGroups service, + # or if the versioned client gem needs an update to support the InterconnectAttachmentGroups service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.interconnect_attachment_groups_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :InterconnectAttachmentGroups + service_module = service_module.const_get :InterconnectAttachmentGroups + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for InterconnectAttachments. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::InterconnectAttachments::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InterconnectAttachments-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the InterconnectAttachments service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the InterconnectAttachments service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.interconnect_attachments_available?}. + # + # ## About InterconnectAttachments + # + # The InterconnectAttachments API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.interconnect_attachments version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InterconnectAttachments) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the InterconnectAttachments service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.interconnect_attachments}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the InterconnectAttachments service, + # or if the versioned client gem needs an update to support the InterconnectAttachments service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.interconnect_attachments_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :InterconnectAttachments + service_module = service_module.const_get :InterconnectAttachments + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for InterconnectGroups. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InterconnectGroups-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the InterconnectGroups service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the InterconnectGroups service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.interconnect_groups_available?}. + # + # ## About InterconnectGroups + # + # The InterconnectGroups API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.interconnect_groups version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InterconnectGroups) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the InterconnectGroups service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.interconnect_groups}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the InterconnectGroups service, + # or if the versioned client gem needs an update to support the InterconnectGroups service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.interconnect_groups_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :InterconnectGroups + service_module = service_module.const_get :InterconnectGroups + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for InterconnectLocations. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::InterconnectLocations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InterconnectLocations-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the InterconnectLocations service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the InterconnectLocations service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.interconnect_locations_available?}. + # + # ## About InterconnectLocations + # + # The InterconnectLocations API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.interconnect_locations version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InterconnectLocations) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the InterconnectLocations service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.interconnect_locations}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the InterconnectLocations service, + # or if the versioned client gem needs an update to support the InterconnectLocations service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.interconnect_locations_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :InterconnectLocations + service_module = service_module.const_get :InterconnectLocations + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for InterconnectRemoteLocations. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::InterconnectRemoteLocations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InterconnectRemoteLocations-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the InterconnectRemoteLocations service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the InterconnectRemoteLocations service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.interconnect_remote_locations_available?}. + # + # ## About InterconnectRemoteLocations + # + # The InterconnectRemoteLocations API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.interconnect_remote_locations version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InterconnectRemoteLocations) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the InterconnectRemoteLocations service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.interconnect_remote_locations}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the InterconnectRemoteLocations service, + # or if the versioned client gem needs an update to support the InterconnectRemoteLocations service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.interconnect_remote_locations_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :InterconnectRemoteLocations + service_module = service_module.const_get :InterconnectRemoteLocations + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Interconnects. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Interconnects::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Interconnects-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Interconnects service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Interconnects service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.interconnects_available?}. + # + # ## About Interconnects + # + # The Interconnects API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.interconnects version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Interconnects) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Interconnects service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.interconnects}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Interconnects service, + # or if the versioned client gem needs an update to support the Interconnects service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.interconnects_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Interconnects + service_module = service_module.const_get :Interconnects + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for LicenseCodes. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::LicenseCodes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-LicenseCodes-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the LicenseCodes service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the LicenseCodes service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.license_codes_available?}. + # + # ## About LicenseCodes + # + # The LicenseCodes API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.license_codes version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:LicenseCodes) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the LicenseCodes service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.license_codes}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the LicenseCodes service, + # or if the versioned client gem needs an update to support the LicenseCodes service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.license_codes_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :LicenseCodes + service_module = service_module.const_get :LicenseCodes + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Licenses. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Licenses::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Licenses-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Licenses service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Licenses service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.licenses_available?}. + # + # ## About Licenses + # + # The Licenses API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.licenses version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Licenses) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Licenses service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.licenses}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Licenses service, + # or if the versioned client gem needs an update to support the Licenses service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.licenses_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Licenses + service_module = service_module.const_get :Licenses + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for MachineImages. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::MachineImages::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-MachineImages-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the MachineImages service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the MachineImages service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.machine_images_available?}. + # + # ## About MachineImages + # + # The MachineImages API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.machine_images version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:MachineImages) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the MachineImages service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.machine_images}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the MachineImages service, + # or if the versioned client gem needs an update to support the MachineImages service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.machine_images_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :MachineImages + service_module = service_module.const_get :MachineImages + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for MachineTypes. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::MachineTypes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-MachineTypes-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the MachineTypes service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the MachineTypes service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.machine_types_available?}. + # + # ## About MachineTypes + # + # The MachineTypes API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.machine_types version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:MachineTypes) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the MachineTypes service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.machine_types}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the MachineTypes service, + # or if the versioned client gem needs an update to support the MachineTypes service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.machine_types_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :MachineTypes + service_module = service_module.const_get :MachineTypes + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for NetworkAttachments. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::NetworkAttachments::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NetworkAttachments-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the NetworkAttachments service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the NetworkAttachments service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.network_attachments_available?}. + # + # ## About NetworkAttachments + # + # The NetworkAttachments API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.network_attachments version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NetworkAttachments) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the NetworkAttachments service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.network_attachments}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the NetworkAttachments service, + # or if the versioned client gem needs an update to support the NetworkAttachments service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.network_attachments_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :NetworkAttachments + service_module = service_module.const_get :NetworkAttachments + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for NetworkEdgeSecurityServices. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::NetworkEdgeSecurityServices::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NetworkEdgeSecurityServices-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the NetworkEdgeSecurityServices service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the NetworkEdgeSecurityServices service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.network_edge_security_services_available?}. + # + # ## About NetworkEdgeSecurityServices + # + # The NetworkEdgeSecurityServices API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.network_edge_security_services version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NetworkEdgeSecurityServices) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the NetworkEdgeSecurityServices service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.network_edge_security_services}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the NetworkEdgeSecurityServices service, + # or if the versioned client gem needs an update to support the NetworkEdgeSecurityServices service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.network_edge_security_services_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :NetworkEdgeSecurityServices + service_module = service_module.const_get :NetworkEdgeSecurityServices + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for NetworkEndpointGroups. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::NetworkEndpointGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NetworkEndpointGroups-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the NetworkEndpointGroups service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the NetworkEndpointGroups service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.network_endpoint_groups_available?}. + # + # ## About NetworkEndpointGroups + # + # The NetworkEndpointGroups API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.network_endpoint_groups version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NetworkEndpointGroups) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the NetworkEndpointGroups service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.network_endpoint_groups}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the NetworkEndpointGroups service, + # or if the versioned client gem needs an update to support the NetworkEndpointGroups service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.network_endpoint_groups_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :NetworkEndpointGroups + service_module = service_module.const_get :NetworkEndpointGroups + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for NetworkFirewallPolicies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::NetworkFirewallPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NetworkFirewallPolicies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the NetworkFirewallPolicies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the NetworkFirewallPolicies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.network_firewall_policies_available?}. + # + # ## About NetworkFirewallPolicies + # + # The NetworkFirewallPolicies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.network_firewall_policies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NetworkFirewallPolicies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the NetworkFirewallPolicies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.network_firewall_policies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the NetworkFirewallPolicies service, + # or if the versioned client gem needs an update to support the NetworkFirewallPolicies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.network_firewall_policies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :NetworkFirewallPolicies + service_module = service_module.const_get :NetworkFirewallPolicies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for NetworkProfiles. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::NetworkProfiles::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NetworkProfiles-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the NetworkProfiles service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the NetworkProfiles service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.network_profiles_available?}. + # + # ## About NetworkProfiles + # + # The NetworkProfiles API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.network_profiles version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NetworkProfiles) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the NetworkProfiles service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.network_profiles}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the NetworkProfiles service, + # or if the versioned client gem needs an update to support the NetworkProfiles service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.network_profiles_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :NetworkProfiles + service_module = service_module.const_get :NetworkProfiles + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Networks. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Networks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Networks-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Networks service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Networks service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.networks_available?}. + # + # ## About Networks + # + # The Networks API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.networks version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Networks) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Networks service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.networks}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Networks service, + # or if the versioned client gem needs an update to support the Networks service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.networks_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Networks + service_module = service_module.const_get :Networks + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for NodeGroups. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::NodeGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NodeGroups-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the NodeGroups service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the NodeGroups service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.node_groups_available?}. + # + # ## About NodeGroups + # + # The NodeGroups API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.node_groups version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NodeGroups) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the NodeGroups service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.node_groups}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the NodeGroups service, + # or if the versioned client gem needs an update to support the NodeGroups service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.node_groups_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :NodeGroups + service_module = service_module.const_get :NodeGroups + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for NodeTemplates. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::NodeTemplates::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NodeTemplates-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the NodeTemplates service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the NodeTemplates service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.node_templates_available?}. + # + # ## About NodeTemplates + # + # The NodeTemplates API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.node_templates version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NodeTemplates) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the NodeTemplates service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.node_templates}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the NodeTemplates service, + # or if the versioned client gem needs an update to support the NodeTemplates service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.node_templates_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :NodeTemplates + service_module = service_module.const_get :NodeTemplates + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for NodeTypes. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::NodeTypes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NodeTypes-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the NodeTypes service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the NodeTypes service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.node_types_available?}. + # + # ## About NodeTypes + # + # The NodeTypes API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.node_types version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NodeTypes) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the NodeTypes service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.node_types}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the NodeTypes service, + # or if the versioned client gem needs an update to support the NodeTypes service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.node_types_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :NodeTypes + service_module = service_module.const_get :NodeTypes + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for OrganizationSecurityPolicies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-OrganizationSecurityPolicies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the OrganizationSecurityPolicies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the OrganizationSecurityPolicies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.organization_security_policies_available?}. + # + # ## About OrganizationSecurityPolicies + # + # The OrganizationSecurityPolicies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.organization_security_policies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:OrganizationSecurityPolicies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the OrganizationSecurityPolicies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.organization_security_policies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the OrganizationSecurityPolicies service, + # or if the versioned client gem needs an update to support the OrganizationSecurityPolicies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.organization_security_policies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :OrganizationSecurityPolicies + service_module = service_module.const_get :OrganizationSecurityPolicies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for PacketMirrorings. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::PacketMirrorings::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-PacketMirrorings-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the PacketMirrorings service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the PacketMirrorings service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.packet_mirrorings_available?}. + # + # ## About PacketMirrorings + # + # The PacketMirrorings API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.packet_mirrorings version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:PacketMirrorings) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the PacketMirrorings service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.packet_mirrorings}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the PacketMirrorings service, + # or if the versioned client gem needs an update to support the PacketMirrorings service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.packet_mirrorings_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :PacketMirrorings + service_module = service_module.const_get :PacketMirrorings + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for PreviewFeatures. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::PreviewFeatures::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-PreviewFeatures-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the PreviewFeatures service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the PreviewFeatures service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.preview_features_available?}. + # + # ## About PreviewFeatures + # + # The PreviewFeatures API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.preview_features version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:PreviewFeatures) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the PreviewFeatures service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.preview_features}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the PreviewFeatures service, + # or if the versioned client gem needs an update to support the PreviewFeatures service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.preview_features_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :PreviewFeatures + service_module = service_module.const_get :PreviewFeatures + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Projects. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Projects::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Projects-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Projects service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Projects service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.projects_available?}. + # + # ## About Projects + # + # The Projects API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.projects version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Projects) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Projects service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.projects}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Projects service, + # or if the versioned client gem needs an update to support the Projects service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.projects_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Projects + service_module = service_module.const_get :Projects + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for PublicAdvertisedPrefixes. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-PublicAdvertisedPrefixes-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the PublicAdvertisedPrefixes service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the PublicAdvertisedPrefixes service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.public_advertised_prefixes_available?}. + # + # ## About PublicAdvertisedPrefixes + # + # The PublicAdvertisedPrefixes API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.public_advertised_prefixes version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:PublicAdvertisedPrefixes) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the PublicAdvertisedPrefixes service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.public_advertised_prefixes}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the PublicAdvertisedPrefixes service, + # or if the versioned client gem needs an update to support the PublicAdvertisedPrefixes service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.public_advertised_prefixes_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :PublicAdvertisedPrefixes + service_module = service_module.const_get :PublicAdvertisedPrefixes + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for PublicDelegatedPrefixes. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::PublicDelegatedPrefixes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-PublicDelegatedPrefixes-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the PublicDelegatedPrefixes service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the PublicDelegatedPrefixes service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.public_delegated_prefixes_available?}. + # + # ## About PublicDelegatedPrefixes + # + # The PublicDelegatedPrefixes API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.public_delegated_prefixes version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:PublicDelegatedPrefixes) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the PublicDelegatedPrefixes service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.public_delegated_prefixes}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the PublicDelegatedPrefixes service, + # or if the versioned client gem needs an update to support the PublicDelegatedPrefixes service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.public_delegated_prefixes_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :PublicDelegatedPrefixes + service_module = service_module.const_get :PublicDelegatedPrefixes + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionAutoscalers. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionAutoscalers::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionAutoscalers-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionAutoscalers service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionAutoscalers service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_autoscalers_available?}. + # + # ## About RegionAutoscalers + # + # The RegionAutoscalers API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_autoscalers version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionAutoscalers) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionAutoscalers service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_autoscalers}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionAutoscalers service, + # or if the versioned client gem needs an update to support the RegionAutoscalers service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_autoscalers_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionAutoscalers + service_module = service_module.const_get :RegionAutoscalers + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionBackendBuckets. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionBackendBuckets::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionBackendBuckets-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionBackendBuckets service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionBackendBuckets service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_backend_buckets_available?}. + # + # ## About RegionBackendBuckets + # + # The RegionBackendBuckets API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_backend_buckets version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionBackendBuckets) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionBackendBuckets service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_backend_buckets}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionBackendBuckets service, + # or if the versioned client gem needs an update to support the RegionBackendBuckets service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_backend_buckets_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionBackendBuckets + service_module = service_module.const_get :RegionBackendBuckets + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionBackendServices. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionBackendServices::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionBackendServices-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionBackendServices service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionBackendServices service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_backend_services_available?}. + # + # ## About RegionBackendServices + # + # The RegionBackendServices API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_backend_services version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionBackendServices) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionBackendServices service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_backend_services}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionBackendServices service, + # or if the versioned client gem needs an update to support the RegionBackendServices service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_backend_services_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionBackendServices + service_module = service_module.const_get :RegionBackendServices + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionCommitments. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionCommitments::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionCommitments-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionCommitments service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionCommitments service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_commitments_available?}. + # + # ## About RegionCommitments + # + # The RegionCommitments API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_commitments version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionCommitments) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionCommitments service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_commitments}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionCommitments service, + # or if the versioned client gem needs an update to support the RegionCommitments service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_commitments_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionCommitments + service_module = service_module.const_get :RegionCommitments + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionCompositeHealthChecks. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionCompositeHealthChecks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionCompositeHealthChecks-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionCompositeHealthChecks service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionCompositeHealthChecks service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_composite_health_checks_available?}. + # + # ## About RegionCompositeHealthChecks + # + # The RegionCompositeHealthChecks API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_composite_health_checks version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionCompositeHealthChecks) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionCompositeHealthChecks service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_composite_health_checks}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionCompositeHealthChecks service, + # or if the versioned client gem needs an update to support the RegionCompositeHealthChecks service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_composite_health_checks_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionCompositeHealthChecks + service_module = service_module.const_get :RegionCompositeHealthChecks + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionDiskTypes. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionDiskTypes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionDiskTypes-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionDiskTypes service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionDiskTypes service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_disk_types_available?}. + # + # ## About RegionDiskTypes + # + # The RegionDiskTypes API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_disk_types version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionDiskTypes) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionDiskTypes service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_disk_types}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionDiskTypes service, + # or if the versioned client gem needs an update to support the RegionDiskTypes service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_disk_types_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionDiskTypes + service_module = service_module.const_get :RegionDiskTypes + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionDisks. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionDisks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionDisks-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionDisks service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionDisks service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_disks_available?}. + # + # ## About RegionDisks + # + # The RegionDisks API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_disks version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionDisks) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionDisks service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_disks}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionDisks service, + # or if the versioned client gem needs an update to support the RegionDisks service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_disks_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionDisks + service_module = service_module.const_get :RegionDisks + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionHealthAggregationPolicies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionHealthAggregationPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionHealthAggregationPolicies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionHealthAggregationPolicies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionHealthAggregationPolicies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_health_aggregation_policies_available?}. + # + # ## About RegionHealthAggregationPolicies + # + # The RegionHealthAggregationPolicies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_health_aggregation_policies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionHealthAggregationPolicies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionHealthAggregationPolicies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_health_aggregation_policies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionHealthAggregationPolicies service, + # or if the versioned client gem needs an update to support the RegionHealthAggregationPolicies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_health_aggregation_policies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionHealthAggregationPolicies + service_module = service_module.const_get :RegionHealthAggregationPolicies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionHealthCheckServices. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionHealthCheckServices::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionHealthCheckServices-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionHealthCheckServices service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionHealthCheckServices service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_health_check_services_available?}. + # + # ## About RegionHealthCheckServices + # + # The RegionHealthCheckServices API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_health_check_services version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionHealthCheckServices) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionHealthCheckServices service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_health_check_services}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionHealthCheckServices service, + # or if the versioned client gem needs an update to support the RegionHealthCheckServices service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_health_check_services_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionHealthCheckServices + service_module = service_module.const_get :RegionHealthCheckServices + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionHealthChecks. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionHealthChecks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionHealthChecks-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionHealthChecks service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionHealthChecks service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_health_checks_available?}. + # + # ## About RegionHealthChecks + # + # The RegionHealthChecks API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_health_checks version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionHealthChecks) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionHealthChecks service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_health_checks}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionHealthChecks service, + # or if the versioned client gem needs an update to support the RegionHealthChecks service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_health_checks_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionHealthChecks + service_module = service_module.const_get :RegionHealthChecks + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionHealthSources. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionHealthSources-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionHealthSources service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionHealthSources service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_health_sources_available?}. + # + # ## About RegionHealthSources + # + # The RegionHealthSources API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_health_sources version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionHealthSources) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionHealthSources service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_health_sources}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionHealthSources service, + # or if the versioned client gem needs an update to support the RegionHealthSources service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_health_sources_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionHealthSources + service_module = service_module.const_get :RegionHealthSources + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionInstanceGroupManagerResizeRequests. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionInstanceGroupManagerResizeRequests::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstanceGroupManagerResizeRequests-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionInstanceGroupManagerResizeRequests service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionInstanceGroupManagerResizeRequests service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_instance_group_manager_resize_requests_available?}. + # + # ## About RegionInstanceGroupManagerResizeRequests + # + # The RegionInstanceGroupManagerResizeRequests API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_instance_group_manager_resize_requests version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstanceGroupManagerResizeRequests) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionInstanceGroupManagerResizeRequests service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instance_group_manager_resize_requests}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionInstanceGroupManagerResizeRequests service, + # or if the versioned client gem needs an update to support the RegionInstanceGroupManagerResizeRequests service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_instance_group_manager_resize_requests_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionInstanceGroupManagerResizeRequests + service_module = service_module.const_get :RegionInstanceGroupManagerResizeRequests + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionInstanceGroupManagers. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstanceGroupManagers-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionInstanceGroupManagers service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionInstanceGroupManagers service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_instance_group_managers_available?}. + # + # ## About RegionInstanceGroupManagers + # + # The RegionInstanceGroupManagers API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_instance_group_managers version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstanceGroupManagers) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionInstanceGroupManagers service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instance_group_managers}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionInstanceGroupManagers service, + # or if the versioned client gem needs an update to support the RegionInstanceGroupManagers service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_instance_group_managers_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionInstanceGroupManagers + service_module = service_module.const_get :RegionInstanceGroupManagers + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionInstanceGroups. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionInstanceGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstanceGroups-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionInstanceGroups service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionInstanceGroups service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_instance_groups_available?}. + # + # ## About RegionInstanceGroups + # + # The RegionInstanceGroups API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_instance_groups version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstanceGroups) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionInstanceGroups service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instance_groups}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionInstanceGroups service, + # or if the versioned client gem needs an update to support the RegionInstanceGroups service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_instance_groups_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionInstanceGroups + service_module = service_module.const_get :RegionInstanceGroups + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionInstanceTemplates. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionInstanceTemplates::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstanceTemplates-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionInstanceTemplates service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionInstanceTemplates service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_instance_templates_available?}. + # + # ## About RegionInstanceTemplates + # + # The RegionInstanceTemplates API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_instance_templates version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstanceTemplates) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionInstanceTemplates service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instance_templates}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionInstanceTemplates service, + # or if the versioned client gem needs an update to support the RegionInstanceTemplates service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_instance_templates_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionInstanceTemplates + service_module = service_module.const_get :RegionInstanceTemplates + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionInstances. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionInstances::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstances-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionInstances service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionInstances service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_instances_available?}. + # + # ## About RegionInstances + # + # The RegionInstances API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_instances version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstances) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionInstances service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instances}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionInstances service, + # or if the versioned client gem needs an update to support the RegionInstances service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_instances_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionInstances + service_module = service_module.const_get :RegionInstances + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionInstantSnapshotGroups. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionInstantSnapshotGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstantSnapshotGroups-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionInstantSnapshotGroups service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionInstantSnapshotGroups service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_instant_snapshot_groups_available?}. + # + # ## About RegionInstantSnapshotGroups + # + # The RegionInstantSnapshotGroups API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_instant_snapshot_groups version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstantSnapshotGroups) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionInstantSnapshotGroups service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instant_snapshot_groups}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionInstantSnapshotGroups service, + # or if the versioned client gem needs an update to support the RegionInstantSnapshotGroups service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_instant_snapshot_groups_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionInstantSnapshotGroups + service_module = service_module.const_get :RegionInstantSnapshotGroups + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionInstantSnapshots. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionInstantSnapshots::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstantSnapshots-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionInstantSnapshots service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionInstantSnapshots service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_instant_snapshots_available?}. + # + # ## About RegionInstantSnapshots + # + # The RegionInstantSnapshots API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_instant_snapshots version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstantSnapshots) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionInstantSnapshots service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instant_snapshots}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionInstantSnapshots service, + # or if the versioned client gem needs an update to support the RegionInstantSnapshots service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_instant_snapshots_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionInstantSnapshots + service_module = service_module.const_get :RegionInstantSnapshots + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionNetworkEndpointGroups. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionNetworkEndpointGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionNetworkEndpointGroups-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionNetworkEndpointGroups service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionNetworkEndpointGroups service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_network_endpoint_groups_available?}. + # + # ## About RegionNetworkEndpointGroups + # + # The RegionNetworkEndpointGroups API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_network_endpoint_groups version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionNetworkEndpointGroups) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionNetworkEndpointGroups service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_network_endpoint_groups}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionNetworkEndpointGroups service, + # or if the versioned client gem needs an update to support the RegionNetworkEndpointGroups service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_network_endpoint_groups_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionNetworkEndpointGroups + service_module = service_module.const_get :RegionNetworkEndpointGroups + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionNetworkFirewallPolicies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionNetworkFirewallPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionNetworkFirewallPolicies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionNetworkFirewallPolicies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionNetworkFirewallPolicies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_network_firewall_policies_available?}. + # + # ## About RegionNetworkFirewallPolicies + # + # The RegionNetworkFirewallPolicies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_network_firewall_policies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionNetworkFirewallPolicies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionNetworkFirewallPolicies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_network_firewall_policies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionNetworkFirewallPolicies service, + # or if the versioned client gem needs an update to support the RegionNetworkFirewallPolicies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_network_firewall_policies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionNetworkFirewallPolicies + service_module = service_module.const_get :RegionNetworkFirewallPolicies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionNotificationEndpoints. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionNotificationEndpoints::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionNotificationEndpoints-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionNotificationEndpoints service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionNotificationEndpoints service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_notification_endpoints_available?}. + # + # ## About RegionNotificationEndpoints + # + # The RegionNotificationEndpoints API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_notification_endpoints version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionNotificationEndpoints) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionNotificationEndpoints service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_notification_endpoints}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionNotificationEndpoints service, + # or if the versioned client gem needs an update to support the RegionNotificationEndpoints service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_notification_endpoints_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionNotificationEndpoints + service_module = service_module.const_get :RegionNotificationEndpoints + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionOperations. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionOperations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionOperations-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionOperations service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionOperations service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_operations_available?}. + # + # ## About RegionOperations + # + # The RegionOperations API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_operations version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionOperations) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionOperations service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_operations}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionOperations service, + # or if the versioned client gem needs an update to support the RegionOperations service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_operations_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionOperations + service_module = service_module.const_get :RegionOperations + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionSecurityPolicies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionSecurityPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionSecurityPolicies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionSecurityPolicies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionSecurityPolicies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_security_policies_available?}. + # + # ## About RegionSecurityPolicies + # + # The RegionSecurityPolicies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_security_policies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionSecurityPolicies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionSecurityPolicies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_security_policies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionSecurityPolicies service, + # or if the versioned client gem needs an update to support the RegionSecurityPolicies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_security_policies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionSecurityPolicies + service_module = service_module.const_get :RegionSecurityPolicies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionSnapshotSettings. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionSnapshotSettings-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionSnapshotSettings service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionSnapshotSettings service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_snapshot_settings_available?}. + # + # ## About RegionSnapshotSettings + # + # The RegionSnapshotSettings API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_snapshot_settings version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionSnapshotSettings) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionSnapshotSettings service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_snapshot_settings}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionSnapshotSettings service, + # or if the versioned client gem needs an update to support the RegionSnapshotSettings service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_snapshot_settings_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionSnapshotSettings + service_module = service_module.const_get :RegionSnapshotSettings + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionSnapshots. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionSnapshots::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionSnapshots-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionSnapshots service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionSnapshots service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_snapshots_available?}. + # + # ## About RegionSnapshots + # + # The RegionSnapshots API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_snapshots version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionSnapshots) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionSnapshots service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_snapshots}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionSnapshots service, + # or if the versioned client gem needs an update to support the RegionSnapshots service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_snapshots_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionSnapshots + service_module = service_module.const_get :RegionSnapshots + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionSslCertificates. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionSslCertificates::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionSslCertificates-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionSslCertificates service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionSslCertificates service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_ssl_certificates_available?}. + # + # ## About RegionSslCertificates + # + # The RegionSslCertificates API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_ssl_certificates version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionSslCertificates) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionSslCertificates service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_ssl_certificates}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionSslCertificates service, + # or if the versioned client gem needs an update to support the RegionSslCertificates service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_ssl_certificates_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionSslCertificates + service_module = service_module.const_get :RegionSslCertificates + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionSslPolicies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionSslPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionSslPolicies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionSslPolicies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionSslPolicies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_ssl_policies_available?}. + # + # ## About RegionSslPolicies + # + # The RegionSslPolicies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_ssl_policies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionSslPolicies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionSslPolicies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_ssl_policies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionSslPolicies service, + # or if the versioned client gem needs an update to support the RegionSslPolicies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_ssl_policies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionSslPolicies + service_module = service_module.const_get :RegionSslPolicies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionTargetHttpProxies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionTargetHttpProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionTargetHttpProxies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionTargetHttpProxies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionTargetHttpProxies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_target_http_proxies_available?}. + # + # ## About RegionTargetHttpProxies + # + # The RegionTargetHttpProxies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_target_http_proxies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionTargetHttpProxies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionTargetHttpProxies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_target_http_proxies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionTargetHttpProxies service, + # or if the versioned client gem needs an update to support the RegionTargetHttpProxies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_target_http_proxies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionTargetHttpProxies + service_module = service_module.const_get :RegionTargetHttpProxies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionTargetHttpsProxies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionTargetHttpsProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionTargetHttpsProxies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionTargetHttpsProxies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionTargetHttpsProxies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_target_https_proxies_available?}. + # + # ## About RegionTargetHttpsProxies + # + # The RegionTargetHttpsProxies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_target_https_proxies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionTargetHttpsProxies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionTargetHttpsProxies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_target_https_proxies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionTargetHttpsProxies service, + # or if the versioned client gem needs an update to support the RegionTargetHttpsProxies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_target_https_proxies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionTargetHttpsProxies + service_module = service_module.const_get :RegionTargetHttpsProxies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionTargetTcpProxies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionTargetTcpProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionTargetTcpProxies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionTargetTcpProxies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionTargetTcpProxies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_target_tcp_proxies_available?}. + # + # ## About RegionTargetTcpProxies + # + # The RegionTargetTcpProxies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_target_tcp_proxies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionTargetTcpProxies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionTargetTcpProxies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_target_tcp_proxies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionTargetTcpProxies service, + # or if the versioned client gem needs an update to support the RegionTargetTcpProxies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_target_tcp_proxies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionTargetTcpProxies + service_module = service_module.const_get :RegionTargetTcpProxies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionUrlMaps. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionUrlMaps::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionUrlMaps-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionUrlMaps service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionUrlMaps service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_url_maps_available?}. + # + # ## About RegionUrlMaps + # + # The RegionUrlMaps API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_url_maps version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionUrlMaps) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionUrlMaps service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_url_maps}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionUrlMaps service, + # or if the versioned client gem needs an update to support the RegionUrlMaps service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_url_maps_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionUrlMaps + service_module = service_module.const_get :RegionUrlMaps + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionZones. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionZones::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionZones-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionZones service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionZones service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_zones_available?}. + # + # ## About RegionZones + # + # The RegionZones API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_zones version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionZones) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionZones service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_zones}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionZones service, + # or if the versioned client gem needs an update to support the RegionZones service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_zones_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionZones + service_module = service_module.const_get :RegionZones + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Regions. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Regions::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Regions-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Regions service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Regions service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.regions_available?}. + # + # ## About Regions + # + # The Regions API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.regions version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Regions) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Regions service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.regions}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Regions service, + # or if the versioned client gem needs an update to support the Regions service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.regions_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Regions + service_module = service_module.const_get :Regions + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ReservationBlocks. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ReservationBlocks-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ReservationBlocks service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the ReservationBlocks service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.reservation_blocks_available?}. + # + # ## About ReservationBlocks + # + # The ReservationBlocks API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.reservation_blocks version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ReservationBlocks) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the ReservationBlocks service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.reservation_blocks}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ReservationBlocks service, + # or if the versioned client gem needs an update to support the ReservationBlocks service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.reservation_blocks_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :ReservationBlocks + service_module = service_module.const_get :ReservationBlocks + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ReservationSlots. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::ReservationSlots::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ReservationSlots-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ReservationSlots service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the ReservationSlots service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.reservation_slots_available?}. + # + # ## About ReservationSlots + # + # The ReservationSlots API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.reservation_slots version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ReservationSlots) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the ReservationSlots service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.reservation_slots}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ReservationSlots service, + # or if the versioned client gem needs an update to support the ReservationSlots service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.reservation_slots_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :ReservationSlots + service_module = service_module.const_get :ReservationSlots + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ReservationSubBlocks. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::ReservationSubBlocks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ReservationSubBlocks-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ReservationSubBlocks service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the ReservationSubBlocks service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.reservation_sub_blocks_available?}. + # + # ## About ReservationSubBlocks + # + # The ReservationSubBlocks API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.reservation_sub_blocks version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ReservationSubBlocks) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the ReservationSubBlocks service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.reservation_sub_blocks}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ReservationSubBlocks service, + # or if the versioned client gem needs an update to support the ReservationSubBlocks service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.reservation_sub_blocks_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :ReservationSubBlocks + service_module = service_module.const_get :ReservationSubBlocks + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Reservations. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Reservations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Reservations-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Reservations service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Reservations service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.reservations_available?}. + # + # ## About Reservations + # + # The Reservations API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.reservations version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Reservations) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Reservations service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.reservations}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Reservations service, + # or if the versioned client gem needs an update to support the Reservations service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.reservations_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Reservations + service_module = service_module.const_get :Reservations + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ResourcePolicies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::ResourcePolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ResourcePolicies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ResourcePolicies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the ResourcePolicies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.resource_policies_available?}. + # + # ## About ResourcePolicies + # + # The ResourcePolicies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.resource_policies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ResourcePolicies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the ResourcePolicies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.resource_policies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ResourcePolicies service, + # or if the versioned client gem needs an update to support the ResourcePolicies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.resource_policies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :ResourcePolicies + service_module = service_module.const_get :ResourcePolicies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Routers. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Routers::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Routers-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Routers service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Routers service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.routers_available?}. + # + # ## About Routers + # + # The Routers API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.routers version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Routers) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Routers service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.routers}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Routers service, + # or if the versioned client gem needs an update to support the Routers service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.routers_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Routers + service_module = service_module.const_get :Routers + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Routes. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Routes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Routes-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Routes service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Routes service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.routes_available?}. + # + # ## About Routes + # + # The Routes API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.routes version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Routes) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Routes service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.routes}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Routes service, + # or if the versioned client gem needs an update to support the Routes service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.routes_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Routes + service_module = service_module.const_get :Routes + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for SecurityPolicies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-SecurityPolicies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the SecurityPolicies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the SecurityPolicies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.security_policies_available?}. + # + # ## About SecurityPolicies + # + # The SecurityPolicies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.security_policies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:SecurityPolicies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the SecurityPolicies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.security_policies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the SecurityPolicies service, + # or if the versioned client gem needs an update to support the SecurityPolicies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.security_policies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :SecurityPolicies + service_module = service_module.const_get :SecurityPolicies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ServiceAttachments. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::ServiceAttachments::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ServiceAttachments-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ServiceAttachments service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the ServiceAttachments service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.service_attachments_available?}. + # + # ## About ServiceAttachments + # + # The ServiceAttachments API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.service_attachments version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ServiceAttachments) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the ServiceAttachments service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.service_attachments}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ServiceAttachments service, + # or if the versioned client gem needs an update to support the ServiceAttachments service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.service_attachments_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :ServiceAttachments + service_module = service_module.const_get :ServiceAttachments + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for SnapshotSettingsService. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::SnapshotSettingsService::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-SnapshotSettingsService-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the SnapshotSettingsService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the SnapshotSettingsService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.snapshot_settings_service_available?}. + # + # ## About SnapshotSettingsService + # + # The SnapshotSettings API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.snapshot_settings_service version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:SnapshotSettingsService) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the SnapshotSettingsService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.snapshot_settings_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the SnapshotSettingsService service, + # or if the versioned client gem needs an update to support the SnapshotSettingsService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.snapshot_settings_service_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :SnapshotSettingsService + service_module = service_module.const_get :SnapshotSettingsService + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Snapshots. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Snapshots::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Snapshots-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Snapshots service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Snapshots service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.snapshots_available?}. + # + # ## About Snapshots + # + # The Snapshots API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.snapshots version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Snapshots) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Snapshots service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.snapshots}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Snapshots service, + # or if the versioned client gem needs an update to support the Snapshots service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.snapshots_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Snapshots + service_module = service_module.const_get :Snapshots + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for SslCertificates. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::SslCertificates::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-SslCertificates-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the SslCertificates service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the SslCertificates service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.ssl_certificates_available?}. + # + # ## About SslCertificates + # + # The SslCertificates API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.ssl_certificates version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:SslCertificates) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the SslCertificates service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.ssl_certificates}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the SslCertificates service, + # or if the versioned client gem needs an update to support the SslCertificates service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.ssl_certificates_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :SslCertificates + service_module = service_module.const_get :SslCertificates + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for SslPolicies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::SslPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-SslPolicies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the SslPolicies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the SslPolicies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.ssl_policies_available?}. + # + # ## About SslPolicies + # + # The SslPolicies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.ssl_policies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:SslPolicies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the SslPolicies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.ssl_policies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the SslPolicies service, + # or if the versioned client gem needs an update to support the SslPolicies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.ssl_policies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :SslPolicies + service_module = service_module.const_get :SslPolicies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for StoragePoolTypes. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::StoragePoolTypes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-StoragePoolTypes-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the StoragePoolTypes service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the StoragePoolTypes service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.storage_pool_types_available?}. + # + # ## About StoragePoolTypes + # + # The StoragePoolTypes API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.storage_pool_types version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:StoragePoolTypes) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the StoragePoolTypes service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.storage_pool_types}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the StoragePoolTypes service, + # or if the versioned client gem needs an update to support the StoragePoolTypes service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.storage_pool_types_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :StoragePoolTypes + service_module = service_module.const_get :StoragePoolTypes + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for StoragePools. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::StoragePools::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-StoragePools-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the StoragePools service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the StoragePools service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.storage_pools_available?}. + # + # ## About StoragePools + # + # The StoragePools API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.storage_pools version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:StoragePools) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the StoragePools service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.storage_pools}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the StoragePools service, + # or if the versioned client gem needs an update to support the StoragePools service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.storage_pools_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :StoragePools + service_module = service_module.const_get :StoragePools + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Subnetworks. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Subnetworks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Subnetworks-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Subnetworks service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Subnetworks service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.subnetworks_available?}. + # + # ## About Subnetworks + # + # The Subnetworks API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.subnetworks version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Subnetworks) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Subnetworks service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.subnetworks}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Subnetworks service, + # or if the versioned client gem needs an update to support the Subnetworks service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.subnetworks_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Subnetworks + service_module = service_module.const_get :Subnetworks + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for TargetGrpcProxies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::TargetGrpcProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetGrpcProxies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TargetGrpcProxies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the TargetGrpcProxies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.target_grpc_proxies_available?}. + # + # ## About TargetGrpcProxies + # + # The TargetGrpcProxies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.target_grpc_proxies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetGrpcProxies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the TargetGrpcProxies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_grpc_proxies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TargetGrpcProxies service, + # or if the versioned client gem needs an update to support the TargetGrpcProxies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.target_grpc_proxies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :TargetGrpcProxies + service_module = service_module.const_get :TargetGrpcProxies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for TargetHttpProxies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::TargetHttpProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetHttpProxies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TargetHttpProxies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the TargetHttpProxies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.target_http_proxies_available?}. + # + # ## About TargetHttpProxies + # + # The TargetHttpProxies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.target_http_proxies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetHttpProxies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the TargetHttpProxies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_http_proxies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TargetHttpProxies service, + # or if the versioned client gem needs an update to support the TargetHttpProxies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.target_http_proxies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :TargetHttpProxies + service_module = service_module.const_get :TargetHttpProxies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for TargetHttpsProxies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::TargetHttpsProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetHttpsProxies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TargetHttpsProxies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the TargetHttpsProxies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.target_https_proxies_available?}. + # + # ## About TargetHttpsProxies + # + # The TargetHttpsProxies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.target_https_proxies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetHttpsProxies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the TargetHttpsProxies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_https_proxies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TargetHttpsProxies service, + # or if the versioned client gem needs an update to support the TargetHttpsProxies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.target_https_proxies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :TargetHttpsProxies + service_module = service_module.const_get :TargetHttpsProxies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for TargetInstances. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::TargetInstances::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetInstances-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TargetInstances service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the TargetInstances service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.target_instances_available?}. + # + # ## About TargetInstances + # + # The TargetInstances API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.target_instances version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetInstances) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the TargetInstances service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_instances}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TargetInstances service, + # or if the versioned client gem needs an update to support the TargetInstances service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.target_instances_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :TargetInstances + service_module = service_module.const_get :TargetInstances + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for TargetPools. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::TargetPools::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetPools-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TargetPools service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the TargetPools service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.target_pools_available?}. + # + # ## About TargetPools + # + # The TargetPools API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.target_pools version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetPools) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the TargetPools service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_pools}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TargetPools service, + # or if the versioned client gem needs an update to support the TargetPools service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.target_pools_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :TargetPools + service_module = service_module.const_get :TargetPools + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for TargetSslProxies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::TargetSslProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetSslProxies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TargetSslProxies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the TargetSslProxies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.target_ssl_proxies_available?}. + # + # ## About TargetSslProxies + # + # The TargetSslProxies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.target_ssl_proxies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetSslProxies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the TargetSslProxies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_ssl_proxies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TargetSslProxies service, + # or if the versioned client gem needs an update to support the TargetSslProxies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.target_ssl_proxies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :TargetSslProxies + service_module = service_module.const_get :TargetSslProxies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for TargetTcpProxies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::TargetTcpProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetTcpProxies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TargetTcpProxies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the TargetTcpProxies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.target_tcp_proxies_available?}. + # + # ## About TargetTcpProxies + # + # The TargetTcpProxies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.target_tcp_proxies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetTcpProxies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the TargetTcpProxies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_tcp_proxies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TargetTcpProxies service, + # or if the versioned client gem needs an update to support the TargetTcpProxies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.target_tcp_proxies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :TargetTcpProxies + service_module = service_module.const_get :TargetTcpProxies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for TargetVpnGateways. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::TargetVpnGateways::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetVpnGateways-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TargetVpnGateways service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the TargetVpnGateways service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.target_vpn_gateways_available?}. + # + # ## About TargetVpnGateways + # + # The TargetVpnGateways API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.target_vpn_gateways version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetVpnGateways) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the TargetVpnGateways service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_vpn_gateways}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TargetVpnGateways service, + # or if the versioned client gem needs an update to support the TargetVpnGateways service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.target_vpn_gateways_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :TargetVpnGateways + service_module = service_module.const_get :TargetVpnGateways + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for UrlMaps. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::UrlMaps::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-UrlMaps-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the UrlMaps service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the UrlMaps service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.url_maps_available?}. + # + # ## About UrlMaps + # + # The UrlMaps API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.url_maps version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:UrlMaps) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the UrlMaps service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.url_maps}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the UrlMaps service, + # or if the versioned client gem needs an update to support the UrlMaps service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.url_maps_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :UrlMaps + service_module = service_module.const_get :UrlMaps + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for VpnGateways. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::VpnGateways::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-VpnGateways-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the VpnGateways service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the VpnGateways service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.vpn_gateways_available?}. + # + # ## About VpnGateways + # + # The VpnGateways API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.vpn_gateways version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:VpnGateways) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the VpnGateways service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.vpn_gateways}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the VpnGateways service, + # or if the versioned client gem needs an update to support the VpnGateways service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.vpn_gateways_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :VpnGateways + service_module = service_module.const_get :VpnGateways + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for VpnTunnels. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::VpnTunnels::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-VpnTunnels-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the VpnTunnels service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the VpnTunnels service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.vpn_tunnels_available?}. + # + # ## About VpnTunnels + # + # The VpnTunnels API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.vpn_tunnels version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:VpnTunnels) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the VpnTunnels service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.vpn_tunnels}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the VpnTunnels service, + # or if the versioned client gem needs an update to support the VpnTunnels service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.vpn_tunnels_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :VpnTunnels + service_module = service_module.const_get :VpnTunnels + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for WireGroups. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::WireGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-WireGroups-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the WireGroups service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the WireGroups service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.wire_groups_available?}. + # + # ## About WireGroups + # + # The WireGroups API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.wire_groups version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:WireGroups) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the WireGroups service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.wire_groups}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the WireGroups service, + # or if the versioned client gem needs an update to support the WireGroups service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.wire_groups_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :WireGroups + service_module = service_module.const_get :WireGroups + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ZoneOperations. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::ZoneOperations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ZoneOperations-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ZoneOperations service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the ZoneOperations service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.zone_operations_available?}. + # + # ## About ZoneOperations + # + # The ZoneOperations API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.zone_operations version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ZoneOperations) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the ZoneOperations service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.zone_operations}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ZoneOperations service, + # or if the versioned client gem needs an update to support the ZoneOperations service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.zone_operations_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :ZoneOperations + service_module = service_module.const_get :ZoneOperations + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ZoneVmExtensionPolicies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::ZoneVmExtensionPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ZoneVmExtensionPolicies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ZoneVmExtensionPolicies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the ZoneVmExtensionPolicies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.zone_vm_extension_policies_available?}. + # + # ## About ZoneVmExtensionPolicies + # + # The ZoneVmExtensionPolicies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.zone_vm_extension_policies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ZoneVmExtensionPolicies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the ZoneVmExtensionPolicies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.zone_vm_extension_policies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ZoneVmExtensionPolicies service, + # or if the versioned client gem needs an update to support the ZoneVmExtensionPolicies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.zone_vm_extension_policies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :ZoneVmExtensionPolicies + service_module = service_module.const_get :ZoneVmExtensionPolicies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Zones. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::Zones::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Zones-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Zones service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Zones service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.zones_available?}. + # + # ## About Zones + # + # The Zones API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.zones version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Zones) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the Zones service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.zones}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Zones service, + # or if the versioned client gem needs an update to support the Zones service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.zones_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :Zones + service_module = service_module.const_get :Zones + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-compute library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # 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 [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.compute if block_given? + + ::Google::Cloud.configure.compute + end + end + end +end + +helper_path = ::File.join __dir__, "compute", "helpers.rb" +require "google/cloud/compute/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-compute/lib/google/cloud/compute/version.rb b/owl-bot-staging/google-cloud-compute/lib/google/cloud/compute/version.rb new file mode 100644 index 000000000000..741d4efe47a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/lib/google/cloud/compute/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Compute + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-compute/test/google/cloud/compute/client_test.rb b/owl-bot-staging/google-cloud-compute/test/google/cloud/compute/client_test.rb new file mode 100644 index 000000000000..9c7fe7e2961e --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/test/google/cloud/compute/client_test.rb @@ -0,0 +1,1242 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "google/cloud/compute" +require "gapic/common" +require "gapic/rest" + +class Google::Cloud::Compute::ClientConstructionMinitest < 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_accelerator_types_rest + skip unless Google::Cloud::Compute.accelerator_types_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.accelerator_types do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::AcceleratorTypes::Rest::Client, client + end + end + + def test_addresses_rest + skip unless Google::Cloud::Compute.addresses_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.addresses do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Addresses::Rest::Client, client + end + end + + def test_advice_rest + skip unless Google::Cloud::Compute.advice_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.advice do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Advice::Rest::Client, client + end + end + + def test_autoscalers_rest + skip unless Google::Cloud::Compute.autoscalers_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.autoscalers do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Autoscalers::Rest::Client, client + end + end + + def test_backend_buckets_rest + skip unless Google::Cloud::Compute.backend_buckets_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.backend_buckets do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::BackendBuckets::Rest::Client, client + end + end + + def test_backend_services_rest + skip unless Google::Cloud::Compute.backend_services_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.backend_services do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::BackendServices::Rest::Client, client + end + end + + def test_cross_site_networks_rest + skip unless Google::Cloud::Compute.cross_site_networks_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.cross_site_networks do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::CrossSiteNetworks::Rest::Client, client + end + end + + def test_disk_types_rest + skip unless Google::Cloud::Compute.disk_types_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.disk_types do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::DiskTypes::Rest::Client, client + end + end + + def test_disks_rest + skip unless Google::Cloud::Compute.disks_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.disks do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Disks::Rest::Client, client + end + end + + def test_external_vpn_gateways_rest + skip unless Google::Cloud::Compute.external_vpn_gateways_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.external_vpn_gateways do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::ExternalVpnGateways::Rest::Client, client + end + end + + def test_firewall_policies_rest + skip unless Google::Cloud::Compute.firewall_policies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.firewall_policies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::FirewallPolicies::Rest::Client, client + end + end + + def test_firewalls_rest + skip unless Google::Cloud::Compute.firewalls_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.firewalls do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Firewalls::Rest::Client, client + end + end + + def test_forwarding_rules_rest + skip unless Google::Cloud::Compute.forwarding_rules_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.forwarding_rules do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::ForwardingRules::Rest::Client, client + end + end + + def test_future_reservations_rest + skip unless Google::Cloud::Compute.future_reservations_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.future_reservations do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::FutureReservations::Rest::Client, client + end + end + + def test_global_addresses_rest + skip unless Google::Cloud::Compute.global_addresses_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.global_addresses do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::GlobalAddresses::Rest::Client, client + end + end + + def test_global_forwarding_rules_rest + skip unless Google::Cloud::Compute.global_forwarding_rules_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.global_forwarding_rules do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::GlobalForwardingRules::Rest::Client, client + end + end + + def test_global_network_endpoint_groups_rest + skip unless Google::Cloud::Compute.global_network_endpoint_groups_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.global_network_endpoint_groups do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::GlobalNetworkEndpointGroups::Rest::Client, client + end + end + + def test_global_operations_rest + skip unless Google::Cloud::Compute.global_operations_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.global_operations do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::GlobalOperations::Rest::Client, client + end + end + + def test_global_organization_operations_rest + skip unless Google::Cloud::Compute.global_organization_operations_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.global_organization_operations do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::Client, client + end + end + + def test_global_public_delegated_prefixes_rest + skip unless Google::Cloud::Compute.global_public_delegated_prefixes_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.global_public_delegated_prefixes do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::GlobalPublicDelegatedPrefixes::Rest::Client, client + end + end + + def test_health_checks_rest + skip unless Google::Cloud::Compute.health_checks_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.health_checks do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::HealthChecks::Rest::Client, client + end + end + + def test_image_family_views_rest + skip unless Google::Cloud::Compute.image_family_views_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.image_family_views do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::ImageFamilyViews::Rest::Client, client + end + end + + def test_images_rest + skip unless Google::Cloud::Compute.images_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.images do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Images::Rest::Client, client + end + end + + def test_instance_group_manager_resize_requests_rest + skip unless Google::Cloud::Compute.instance_group_manager_resize_requests_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.instance_group_manager_resize_requests do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client, client + end + end + + def test_instance_group_managers_rest + skip unless Google::Cloud::Compute.instance_group_managers_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.instance_group_managers do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client, client + end + end + + def test_instance_groups_rest + skip unless Google::Cloud::Compute.instance_groups_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.instance_groups do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::InstanceGroups::Rest::Client, client + end + end + + def test_instance_settings_service_rest + skip unless Google::Cloud::Compute.instance_settings_service_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.instance_settings_service do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::InstanceSettingsService::Rest::Client, client + end + end + + def test_instance_templates_rest + skip unless Google::Cloud::Compute.instance_templates_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.instance_templates do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::InstanceTemplates::Rest::Client, client + end + end + + def test_instances_rest + skip unless Google::Cloud::Compute.instances_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.instances do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Instances::Rest::Client, client + end + end + + def test_instant_snapshot_groups_rest + skip unless Google::Cloud::Compute.instant_snapshot_groups_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.instant_snapshot_groups do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::InstantSnapshotGroups::Rest::Client, client + end + end + + def test_instant_snapshots_rest + skip unless Google::Cloud::Compute.instant_snapshots_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.instant_snapshots do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::InstantSnapshots::Rest::Client, client + end + end + + def test_interconnect_attachment_groups_rest + skip unless Google::Cloud::Compute.interconnect_attachment_groups_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.interconnect_attachment_groups do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client, client + end + end + + def test_interconnect_attachments_rest + skip unless Google::Cloud::Compute.interconnect_attachments_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.interconnect_attachments do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::InterconnectAttachments::Rest::Client, client + end + end + + def test_interconnect_groups_rest + skip unless Google::Cloud::Compute.interconnect_groups_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.interconnect_groups do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client, client + end + end + + def test_interconnect_locations_rest + skip unless Google::Cloud::Compute.interconnect_locations_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.interconnect_locations do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::InterconnectLocations::Rest::Client, client + end + end + + def test_interconnect_remote_locations_rest + skip unless Google::Cloud::Compute.interconnect_remote_locations_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.interconnect_remote_locations do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::InterconnectRemoteLocations::Rest::Client, client + end + end + + def test_interconnects_rest + skip unless Google::Cloud::Compute.interconnects_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.interconnects do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Interconnects::Rest::Client, client + end + end + + def test_license_codes_rest + skip unless Google::Cloud::Compute.license_codes_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.license_codes do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::LicenseCodes::Rest::Client, client + end + end + + def test_licenses_rest + skip unless Google::Cloud::Compute.licenses_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.licenses do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Licenses::Rest::Client, client + end + end + + def test_machine_images_rest + skip unless Google::Cloud::Compute.machine_images_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.machine_images do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::MachineImages::Rest::Client, client + end + end + + def test_machine_types_rest + skip unless Google::Cloud::Compute.machine_types_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.machine_types do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::MachineTypes::Rest::Client, client + end + end + + def test_network_attachments_rest + skip unless Google::Cloud::Compute.network_attachments_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.network_attachments do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::NetworkAttachments::Rest::Client, client + end + end + + def test_network_edge_security_services_rest + skip unless Google::Cloud::Compute.network_edge_security_services_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.network_edge_security_services do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::NetworkEdgeSecurityServices::Rest::Client, client + end + end + + def test_network_endpoint_groups_rest + skip unless Google::Cloud::Compute.network_endpoint_groups_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.network_endpoint_groups do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::NetworkEndpointGroups::Rest::Client, client + end + end + + def test_network_firewall_policies_rest + skip unless Google::Cloud::Compute.network_firewall_policies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.network_firewall_policies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::NetworkFirewallPolicies::Rest::Client, client + end + end + + def test_network_profiles_rest + skip unless Google::Cloud::Compute.network_profiles_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.network_profiles do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::NetworkProfiles::Rest::Client, client + end + end + + def test_networks_rest + skip unless Google::Cloud::Compute.networks_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.networks do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Networks::Rest::Client, client + end + end + + def test_node_groups_rest + skip unless Google::Cloud::Compute.node_groups_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.node_groups do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::NodeGroups::Rest::Client, client + end + end + + def test_node_templates_rest + skip unless Google::Cloud::Compute.node_templates_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.node_templates do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::NodeTemplates::Rest::Client, client + end + end + + def test_node_types_rest + skip unless Google::Cloud::Compute.node_types_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.node_types do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::NodeTypes::Rest::Client, client + end + end + + def test_organization_security_policies_rest + skip unless Google::Cloud::Compute.organization_security_policies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.organization_security_policies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client, client + end + end + + def test_packet_mirrorings_rest + skip unless Google::Cloud::Compute.packet_mirrorings_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.packet_mirrorings do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::PacketMirrorings::Rest::Client, client + end + end + + def test_preview_features_rest + skip unless Google::Cloud::Compute.preview_features_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.preview_features do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::PreviewFeatures::Rest::Client, client + end + end + + def test_projects_rest + skip unless Google::Cloud::Compute.projects_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.projects do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Projects::Rest::Client, client + end + end + + def test_public_advertised_prefixes_rest + skip unless Google::Cloud::Compute.public_advertised_prefixes_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.public_advertised_prefixes do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client, client + end + end + + def test_public_delegated_prefixes_rest + skip unless Google::Cloud::Compute.public_delegated_prefixes_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.public_delegated_prefixes do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::PublicDelegatedPrefixes::Rest::Client, client + end + end + + def test_region_autoscalers_rest + skip unless Google::Cloud::Compute.region_autoscalers_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_autoscalers do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionAutoscalers::Rest::Client, client + end + end + + def test_region_backend_buckets_rest + skip unless Google::Cloud::Compute.region_backend_buckets_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_backend_buckets do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionBackendBuckets::Rest::Client, client + end + end + + def test_region_backend_services_rest + skip unless Google::Cloud::Compute.region_backend_services_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_backend_services do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionBackendServices::Rest::Client, client + end + end + + def test_region_commitments_rest + skip unless Google::Cloud::Compute.region_commitments_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_commitments do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionCommitments::Rest::Client, client + end + end + + def test_region_composite_health_checks_rest + skip unless Google::Cloud::Compute.region_composite_health_checks_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_composite_health_checks do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionCompositeHealthChecks::Rest::Client, client + end + end + + def test_region_disk_types_rest + skip unless Google::Cloud::Compute.region_disk_types_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_disk_types do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionDiskTypes::Rest::Client, client + end + end + + def test_region_disks_rest + skip unless Google::Cloud::Compute.region_disks_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_disks do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionDisks::Rest::Client, client + end + end + + def test_region_health_aggregation_policies_rest + skip unless Google::Cloud::Compute.region_health_aggregation_policies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_health_aggregation_policies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionHealthAggregationPolicies::Rest::Client, client + end + end + + def test_region_health_check_services_rest + skip unless Google::Cloud::Compute.region_health_check_services_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_health_check_services do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionHealthCheckServices::Rest::Client, client + end + end + + def test_region_health_checks_rest + skip unless Google::Cloud::Compute.region_health_checks_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_health_checks do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionHealthChecks::Rest::Client, client + end + end + + def test_region_health_sources_rest + skip unless Google::Cloud::Compute.region_health_sources_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_health_sources do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client, client + end + end + + def test_region_instance_group_manager_resize_requests_rest + skip unless Google::Cloud::Compute.region_instance_group_manager_resize_requests_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_instance_group_manager_resize_requests do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionInstanceGroupManagerResizeRequests::Rest::Client, client + end + end + + def test_region_instance_group_managers_rest + skip unless Google::Cloud::Compute.region_instance_group_managers_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_instance_group_managers do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Rest::Client, client + end + end + + def test_region_instance_groups_rest + skip unless Google::Cloud::Compute.region_instance_groups_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_instance_groups do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionInstanceGroups::Rest::Client, client + end + end + + def test_region_instance_templates_rest + skip unless Google::Cloud::Compute.region_instance_templates_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_instance_templates do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionInstanceTemplates::Rest::Client, client + end + end + + def test_region_instances_rest + skip unless Google::Cloud::Compute.region_instances_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_instances do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionInstances::Rest::Client, client + end + end + + def test_region_instant_snapshot_groups_rest + skip unless Google::Cloud::Compute.region_instant_snapshot_groups_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_instant_snapshot_groups do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionInstantSnapshotGroups::Rest::Client, client + end + end + + def test_region_instant_snapshots_rest + skip unless Google::Cloud::Compute.region_instant_snapshots_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_instant_snapshots do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionInstantSnapshots::Rest::Client, client + end + end + + def test_region_network_endpoint_groups_rest + skip unless Google::Cloud::Compute.region_network_endpoint_groups_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_network_endpoint_groups do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionNetworkEndpointGroups::Rest::Client, client + end + end + + def test_region_network_firewall_policies_rest + skip unless Google::Cloud::Compute.region_network_firewall_policies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_network_firewall_policies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionNetworkFirewallPolicies::Rest::Client, client + end + end + + def test_region_notification_endpoints_rest + skip unless Google::Cloud::Compute.region_notification_endpoints_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_notification_endpoints do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionNotificationEndpoints::Rest::Client, client + end + end + + def test_region_operations_rest + skip unless Google::Cloud::Compute.region_operations_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_operations do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionOperations::Rest::Client, client + end + end + + def test_region_security_policies_rest + skip unless Google::Cloud::Compute.region_security_policies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_security_policies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionSecurityPolicies::Rest::Client, client + end + end + + def test_region_snapshot_settings_rest + skip unless Google::Cloud::Compute.region_snapshot_settings_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_snapshot_settings do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::Client, client + end + end + + def test_region_snapshots_rest + skip unless Google::Cloud::Compute.region_snapshots_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_snapshots do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionSnapshots::Rest::Client, client + end + end + + def test_region_ssl_certificates_rest + skip unless Google::Cloud::Compute.region_ssl_certificates_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_ssl_certificates do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionSslCertificates::Rest::Client, client + end + end + + def test_region_ssl_policies_rest + skip unless Google::Cloud::Compute.region_ssl_policies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_ssl_policies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionSslPolicies::Rest::Client, client + end + end + + def test_region_target_http_proxies_rest + skip unless Google::Cloud::Compute.region_target_http_proxies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_target_http_proxies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionTargetHttpProxies::Rest::Client, client + end + end + + def test_region_target_https_proxies_rest + skip unless Google::Cloud::Compute.region_target_https_proxies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_target_https_proxies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionTargetHttpsProxies::Rest::Client, client + end + end + + def test_region_target_tcp_proxies_rest + skip unless Google::Cloud::Compute.region_target_tcp_proxies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_target_tcp_proxies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionTargetTcpProxies::Rest::Client, client + end + end + + def test_region_url_maps_rest + skip unless Google::Cloud::Compute.region_url_maps_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_url_maps do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionUrlMaps::Rest::Client, client + end + end + + def test_region_zones_rest + skip unless Google::Cloud::Compute.region_zones_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_zones do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionZones::Rest::Client, client + end + end + + def test_regions_rest + skip unless Google::Cloud::Compute.regions_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.regions do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Regions::Rest::Client, client + end + end + + def test_reservation_blocks_rest + skip unless Google::Cloud::Compute.reservation_blocks_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.reservation_blocks do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client, client + end + end + + def test_reservation_slots_rest + skip unless Google::Cloud::Compute.reservation_slots_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.reservation_slots do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::ReservationSlots::Rest::Client, client + end + end + + def test_reservation_sub_blocks_rest + skip unless Google::Cloud::Compute.reservation_sub_blocks_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.reservation_sub_blocks do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::ReservationSubBlocks::Rest::Client, client + end + end + + def test_reservations_rest + skip unless Google::Cloud::Compute.reservations_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.reservations do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Reservations::Rest::Client, client + end + end + + def test_resource_policies_rest + skip unless Google::Cloud::Compute.resource_policies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.resource_policies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::ResourcePolicies::Rest::Client, client + end + end + + def test_routers_rest + skip unless Google::Cloud::Compute.routers_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.routers do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Routers::Rest::Client, client + end + end + + def test_routes_rest + skip unless Google::Cloud::Compute.routes_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.routes do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Routes::Rest::Client, client + end + end + + def test_security_policies_rest + skip unless Google::Cloud::Compute.security_policies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.security_policies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client, client + end + end + + def test_service_attachments_rest + skip unless Google::Cloud::Compute.service_attachments_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.service_attachments do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::ServiceAttachments::Rest::Client, client + end + end + + def test_snapshot_settings_service_rest + skip unless Google::Cloud::Compute.snapshot_settings_service_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.snapshot_settings_service do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::SnapshotSettingsService::Rest::Client, client + end + end + + def test_snapshots_rest + skip unless Google::Cloud::Compute.snapshots_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.snapshots do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Snapshots::Rest::Client, client + end + end + + def test_ssl_certificates_rest + skip unless Google::Cloud::Compute.ssl_certificates_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.ssl_certificates do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::SslCertificates::Rest::Client, client + end + end + + def test_ssl_policies_rest + skip unless Google::Cloud::Compute.ssl_policies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.ssl_policies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::SslPolicies::Rest::Client, client + end + end + + def test_storage_pool_types_rest + skip unless Google::Cloud::Compute.storage_pool_types_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.storage_pool_types do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::StoragePoolTypes::Rest::Client, client + end + end + + def test_storage_pools_rest + skip unless Google::Cloud::Compute.storage_pools_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.storage_pools do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::StoragePools::Rest::Client, client + end + end + + def test_subnetworks_rest + skip unless Google::Cloud::Compute.subnetworks_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.subnetworks do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Subnetworks::Rest::Client, client + end + end + + def test_target_grpc_proxies_rest + skip unless Google::Cloud::Compute.target_grpc_proxies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.target_grpc_proxies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::TargetGrpcProxies::Rest::Client, client + end + end + + def test_target_http_proxies_rest + skip unless Google::Cloud::Compute.target_http_proxies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.target_http_proxies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::TargetHttpProxies::Rest::Client, client + end + end + + def test_target_https_proxies_rest + skip unless Google::Cloud::Compute.target_https_proxies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.target_https_proxies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::TargetHttpsProxies::Rest::Client, client + end + end + + def test_target_instances_rest + skip unless Google::Cloud::Compute.target_instances_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.target_instances do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::TargetInstances::Rest::Client, client + end + end + + def test_target_pools_rest + skip unless Google::Cloud::Compute.target_pools_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.target_pools do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::TargetPools::Rest::Client, client + end + end + + def test_target_ssl_proxies_rest + skip unless Google::Cloud::Compute.target_ssl_proxies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.target_ssl_proxies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::TargetSslProxies::Rest::Client, client + end + end + + def test_target_tcp_proxies_rest + skip unless Google::Cloud::Compute.target_tcp_proxies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.target_tcp_proxies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::TargetTcpProxies::Rest::Client, client + end + end + + def test_target_vpn_gateways_rest + skip unless Google::Cloud::Compute.target_vpn_gateways_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.target_vpn_gateways do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::TargetVpnGateways::Rest::Client, client + end + end + + def test_url_maps_rest + skip unless Google::Cloud::Compute.url_maps_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.url_maps do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::UrlMaps::Rest::Client, client + end + end + + def test_vpn_gateways_rest + skip unless Google::Cloud::Compute.vpn_gateways_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.vpn_gateways do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::VpnGateways::Rest::Client, client + end + end + + def test_vpn_tunnels_rest + skip unless Google::Cloud::Compute.vpn_tunnels_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.vpn_tunnels do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::VpnTunnels::Rest::Client, client + end + end + + def test_wire_groups_rest + skip unless Google::Cloud::Compute.wire_groups_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.wire_groups do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::WireGroups::Rest::Client, client + end + end + + def test_zone_operations_rest + skip unless Google::Cloud::Compute.zone_operations_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.zone_operations do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::ZoneOperations::Rest::Client, client + end + end + + def test_zone_vm_extension_policies_rest + skip unless Google::Cloud::Compute.zone_vm_extension_policies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.zone_vm_extension_policies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::ZoneVmExtensionPolicies::Rest::Client, client + end + end + + def test_zones_rest + skip unless Google::Cloud::Compute.zones_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.zones do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::Zones::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-compute/test/google/cloud/compute/version_test.rb b/owl-bot-staging/google-cloud-compute/test/google/cloud/compute/version_test.rb new file mode 100644 index 000000000000..9af84994fa5a --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/test/google/cloud/compute/version_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "google/cloud/compute/version" + +class Google::Cloud::Compute::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::Compute::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-compute/test/helper.rb b/owl-bot-staging/google-cloud-compute/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-compute/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" From f9c4d46e6ea015ce134210552a9748a42c9565a8 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 25 Apr 2026 01:05:32 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../lib/google/cloud/compute.rb | 441 + .../test/google/cloud/compute/client_test.rb | 70 + .../google-cloud-compute/.gitignore | 22 - .../google-cloud-compute/.repo-metadata.json | 18 - .../google-cloud-compute/.rubocop.yml | 39 - owl-bot-staging/google-cloud-compute/.toys.rb | 28 - .../google-cloud-compute/.yardopts | 11 - .../google-cloud-compute/AUTHENTICATION.md | 122 - .../google-cloud-compute/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-compute/Gemfile | 31 - .../google-cloud-compute/LICENSE.md | 201 - .../google-cloud-compute/README.md | 142 - owl-bot-staging/google-cloud-compute/Rakefile | 169 - .../google-cloud-compute.gemspec | 27 - .../lib/google-cloud-compute.rb | 19 - .../lib/google/cloud/compute.rb | 7645 ----------------- .../lib/google/cloud/compute/version.rb | 26 - .../test/google/cloud/compute/client_test.rb | 1242 --- .../test/google/cloud/compute/version_test.rb | 26 - .../google-cloud-compute/test/helper.rb | 26 - 20 files changed, 511 insertions(+), 9796 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-compute/.gitignore delete mode 100644 owl-bot-staging/google-cloud-compute/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-compute/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-compute/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-compute/.yardopts delete mode 100644 owl-bot-staging/google-cloud-compute/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-compute/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-compute/Gemfile delete mode 100644 owl-bot-staging/google-cloud-compute/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-compute/README.md delete mode 100644 owl-bot-staging/google-cloud-compute/Rakefile delete mode 100644 owl-bot-staging/google-cloud-compute/google-cloud-compute.gemspec delete mode 100644 owl-bot-staging/google-cloud-compute/lib/google-cloud-compute.rb delete mode 100644 owl-bot-staging/google-cloud-compute/lib/google/cloud/compute.rb delete mode 100644 owl-bot-staging/google-cloud-compute/lib/google/cloud/compute/version.rb delete mode 100644 owl-bot-staging/google-cloud-compute/test/google/cloud/compute/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-compute/test/google/cloud/compute/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-compute/test/helper.rb diff --git a/google-cloud-compute/lib/google/cloud/compute.rb b/google-cloud-compute/lib/google/cloud/compute.rb index 75c107ed04c1..01babeec8a43 100755 --- a/google-cloud-compute/lib/google/cloud/compute.rb +++ b/google-cloud-compute/lib/google/cloud/compute.rb @@ -1873,6 +1873,69 @@ def self.instances_available? version: :v1 false end + ## + # Create a new client object for InstantSnapshotGroups. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::InstantSnapshotGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InstantSnapshotGroups-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the InstantSnapshotGroups service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the InstantSnapshotGroups service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.instant_snapshot_groups_available?}. + # + # ## About InstantSnapshotGroups + # + # The InstantSnapshotGroups API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.instant_snapshot_groups version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InstantSnapshotGroups) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the InstantSnapshotGroups service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instant_snapshot_groups}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the InstantSnapshotGroups service, + # or if the versioned client gem needs an update to support the InstantSnapshotGroups service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.instant_snapshot_groups_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :InstantSnapshotGroups + service_module = service_module.const_get :InstantSnapshotGroups + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + ## # Create a new client object for InstantSnapshots. # @@ -3574,6 +3637,69 @@ def self.region_autoscalers_available? version: :v1 false end + ## + # Create a new client object for RegionBackendBuckets. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionBackendBuckets::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionBackendBuckets-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionBackendBuckets service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionBackendBuckets service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_backend_buckets_available?}. + # + # ## About RegionBackendBuckets + # + # The RegionBackendBuckets API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_backend_buckets version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionBackendBuckets) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionBackendBuckets service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_backend_buckets}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionBackendBuckets service, + # or if the versioned client gem needs an update to support the RegionBackendBuckets service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_backend_buckets_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionBackendBuckets + service_module = service_module.const_get :RegionBackendBuckets + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + ## # Create a new client object for RegionBackendServices. # @@ -4141,6 +4267,69 @@ def self.region_health_sources_available? version: :v1 false end + ## + # Create a new client object for RegionInstanceGroupManagerResizeRequests. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionInstanceGroupManagerResizeRequests::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstanceGroupManagerResizeRequests-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionInstanceGroupManagerResizeRequests service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionInstanceGroupManagerResizeRequests service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_instance_group_manager_resize_requests_available?}. + # + # ## About RegionInstanceGroupManagerResizeRequests + # + # The RegionInstanceGroupManagerResizeRequests API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_instance_group_manager_resize_requests version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstanceGroupManagerResizeRequests) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionInstanceGroupManagerResizeRequests service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instance_group_manager_resize_requests}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionInstanceGroupManagerResizeRequests service, + # or if the versioned client gem needs an update to support the RegionInstanceGroupManagerResizeRequests service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_instance_group_manager_resize_requests_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionInstanceGroupManagerResizeRequests + service_module = service_module.const_get :RegionInstanceGroupManagerResizeRequests + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + ## # Create a new client object for RegionInstanceGroupManagers. # @@ -4393,6 +4582,69 @@ def self.region_instances_available? version: :v1 false end + ## + # Create a new client object for RegionInstantSnapshotGroups. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionInstantSnapshotGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstantSnapshotGroups-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionInstantSnapshotGroups service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionInstantSnapshotGroups service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_instant_snapshot_groups_available?}. + # + # ## About RegionInstantSnapshotGroups + # + # The RegionInstantSnapshotGroups API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_instant_snapshot_groups version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstantSnapshotGroups) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionInstantSnapshotGroups service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instant_snapshot_groups}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionInstantSnapshotGroups service, + # or if the versioned client gem needs an update to support the RegionInstantSnapshotGroups service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_instant_snapshot_groups_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionInstantSnapshotGroups + service_module = service_module.const_get :RegionInstantSnapshotGroups + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + ## # Create a new client object for RegionInstantSnapshots. # @@ -4771,6 +5023,132 @@ def self.region_security_policies_available? version: :v1 false end + ## + # Create a new client object for RegionSnapshotSettings. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionSnapshotSettings-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionSnapshotSettings service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionSnapshotSettings service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_snapshot_settings_available?}. + # + # ## About RegionSnapshotSettings + # + # The RegionSnapshotSettings API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_snapshot_settings version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionSnapshotSettings) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionSnapshotSettings service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_snapshot_settings}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionSnapshotSettings service, + # or if the versioned client gem needs an update to support the RegionSnapshotSettings service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_snapshot_settings_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionSnapshotSettings + service_module = service_module.const_get :RegionSnapshotSettings + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for RegionSnapshots. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::RegionSnapshots::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionSnapshots-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the RegionSnapshots service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the RegionSnapshots service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.region_snapshots_available?}. + # + # ## About RegionSnapshots + # + # The RegionSnapshots API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.region_snapshots version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionSnapshots) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the RegionSnapshots service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_snapshots}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RegionSnapshots service, + # or if the versioned client gem needs an update to support the RegionSnapshots service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.region_snapshots_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :RegionSnapshots + service_module = service_module.const_get :RegionSnapshots + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + ## # Create a new client object for RegionSslCertificates. # @@ -7102,6 +7480,69 @@ def self.zone_operations_available? version: :v1 false end + ## + # Create a new client object for ZoneVmExtensionPolicies. + # + # By default, this returns an instance of + # [Google::Cloud::Compute::V1::ZoneVmExtensionPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ZoneVmExtensionPolicies-Rest-Client) + # for a REST client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ZoneVmExtensionPolicies service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the ZoneVmExtensionPolicies service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Compute.zone_vm_extension_policies_available?}. + # + # ## About ZoneVmExtensionPolicies + # + # The ZoneVmExtensionPolicies API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.zone_vm_extension_policies version: :v1, &block + require "google/cloud/compute/#{version.to_s.downcase}" + + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ZoneVmExtensionPolicies) + service_module.const_get(:Rest).const_get(:Client).new(&block) + end + + ## + # Determines whether the ZoneVmExtensionPolicies service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Compute.zone_vm_extension_policies}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ZoneVmExtensionPolicies service, + # or if the versioned client gem needs an update to support the ZoneVmExtensionPolicies service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.zone_vm_extension_policies_available? version: :v1 + require "google/cloud/compute/#{version.to_s.downcase}" + package_name = Google::Cloud::Compute + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Compute.const_get package_name + return false unless service_module.const_defined? :ZoneVmExtensionPolicies + service_module = service_module.const_get :ZoneVmExtensionPolicies + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + service_module.const_defined? :Client + rescue ::LoadError + false + end + ## # Create a new client object for Zones. # diff --git a/google-cloud-compute/test/google/cloud/compute/client_test.rb b/google-cloud-compute/test/google/cloud/compute/client_test.rb index af0c9ceb17f2..8827dabf9ead 100755 --- a/google-cloud-compute/test/google/cloud/compute/client_test.rb +++ b/google-cloud-compute/test/google/cloud/compute/client_test.rb @@ -330,6 +330,16 @@ def test_instances_rest end end + def test_instant_snapshot_groups_rest + skip unless Google::Cloud::Compute.instant_snapshot_groups_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.instant_snapshot_groups do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::InstantSnapshotGroups::Rest::Client, client + end + end + def test_instant_snapshots_rest skip unless Google::Cloud::Compute.instant_snapshots_available? Gapic::Rest::ClientStub.stub :new, DummyStub.new do @@ -600,6 +610,16 @@ def test_region_autoscalers_rest end end + def test_region_backend_buckets_rest + skip unless Google::Cloud::Compute.region_backend_buckets_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_backend_buckets do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionBackendBuckets::Rest::Client, client + end + end + def test_region_backend_services_rest skip unless Google::Cloud::Compute.region_backend_services_available? Gapic::Rest::ClientStub.stub :new, DummyStub.new do @@ -690,6 +710,16 @@ def test_region_health_sources_rest end end + def test_region_instance_group_manager_resize_requests_rest + skip unless Google::Cloud::Compute.region_instance_group_manager_resize_requests_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_instance_group_manager_resize_requests do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionInstanceGroupManagerResizeRequests::Rest::Client, client + end + end + def test_region_instance_group_managers_rest skip unless Google::Cloud::Compute.region_instance_group_managers_available? Gapic::Rest::ClientStub.stub :new, DummyStub.new do @@ -730,6 +760,16 @@ def test_region_instances_rest end end + def test_region_instant_snapshot_groups_rest + skip unless Google::Cloud::Compute.region_instant_snapshot_groups_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_instant_snapshot_groups do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionInstantSnapshotGroups::Rest::Client, client + end + end + def test_region_instant_snapshots_rest skip unless Google::Cloud::Compute.region_instant_snapshots_available? Gapic::Rest::ClientStub.stub :new, DummyStub.new do @@ -790,6 +830,26 @@ def test_region_security_policies_rest end end + def test_region_snapshot_settings_rest + skip unless Google::Cloud::Compute.region_snapshot_settings_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_snapshot_settings do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::Client, client + end + end + + def test_region_snapshots_rest + skip unless Google::Cloud::Compute.region_snapshots_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.region_snapshots do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::RegionSnapshots::Rest::Client, client + end + end + def test_region_ssl_certificates_rest skip unless Google::Cloud::Compute.region_ssl_certificates_available? Gapic::Rest::ClientStub.stub :new, DummyStub.new do @@ -1160,6 +1220,16 @@ def test_zone_operations_rest end end + def test_zone_vm_extension_policies_rest + skip unless Google::Cloud::Compute.zone_vm_extension_policies_available? + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Compute.zone_vm_extension_policies do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Compute::V1::ZoneVmExtensionPolicies::Rest::Client, client + end + end + def test_zones_rest skip unless Google::Cloud::Compute.zones_available? Gapic::Rest::ClientStub.stub :new, DummyStub.new do diff --git a/owl-bot-staging/google-cloud-compute/.gitignore b/owl-bot-staging/google-cloud-compute/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-compute/.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-compute/.repo-metadata.json b/owl-bot-staging/google-cloud-compute/.repo-metadata.json deleted file mode 100644 index 3070ce18f1a6..000000000000 --- a/owl-bot-staging/google-cloud-compute/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "compute.googleapis.com", - "api_shortname": "compute", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-compute/latest", - "distribution_name": "google-cloud-compute", - "is_cloud": true, - "language": "ruby", - "name": "compute", - "name_pretty": "Google Cloud Compute API", - "product_documentation": "https://cloud.google.com/compute/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "google-cloud-compute is the official client library for the Google Cloud Compute API.", - "ruby-cloud-env-prefix": "COMPUTE", - "ruby-cloud-product-url": "https://cloud.google.com/compute/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-compute/.rubocop.yml b/owl-bot-staging/google-cloud-compute/.rubocop.yml deleted file mode 100644 index ce239dc46710..000000000000 --- a/owl-bot-staging/google-cloud-compute/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-compute.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-compute.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-compute/.toys.rb b/owl-bot-staging/google-cloud-compute/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-compute/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-compute/.yardopts b/owl-bot-staging/google-cloud-compute/.yardopts deleted file mode 100644 index 2207b657d0dd..000000000000 --- a/owl-bot-staging/google-cloud-compute/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Google Cloud Compute API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-compute/AUTHENTICATION.md b/owl-bot-staging/google-cloud-compute/AUTHENTICATION.md deleted file mode 100644 index 0933f5e25695..000000000000 --- a/owl-bot-staging/google-cloud-compute/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-compute 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-compute 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/compute" - -client = Google::Cloud::Compute.accelerator_types do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/compute" - -Google::Cloud::Compute.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::Compute.accelerator_types -``` - -### 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-compute -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/compute" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::Compute.accelerator_types -``` - -### 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-compute/CHANGELOG.md b/owl-bot-staging/google-cloud-compute/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-compute/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-compute/Gemfile b/owl-bot-staging/google-cloud-compute/Gemfile deleted file mode 100644 index 23ff6506a8a0..000000000000 --- a/owl-bot-staging/google-cloud-compute/Gemfile +++ /dev/null @@ -1,31 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-compute-v1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-compute.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-compute/LICENSE.md b/owl-bot-staging/google-cloud-compute/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-compute/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-compute/README.md b/owl-bot-staging/google-cloud-compute/README.md deleted file mode 100644 index 99c7a733ef5a..000000000000 --- a/owl-bot-staging/google-cloud-compute/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Google Cloud Compute API - -API Client library for the Google Cloud Compute API - -google-cloud-compute is the official client library for the Google Cloud Compute API. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-compute-v*`. -The gem `google-cloud-compute` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-compute/latest) -for this library, google-cloud-compute, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-compute-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/compute/) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-compute -``` - -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/compute.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/compute" - -client = Google::Cloud::Compute.accelerator_types -request = ::Google::Cloud::Compute::V1::AggregatedListAcceleratorTypesRequest.new # (request fields as keyword arguments...) -response = client.aggregated_list request -``` - -## 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. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-compute-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest). - -## 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-compute`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-compute-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-compute`. -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-compute-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-compute/Rakefile b/owl-bot-staging/google-cloud-compute/Rakefile deleted file mode 100644 index 39e754c29855..000000000000 --- a/owl-bot-staging/google-cloud-compute/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = true -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-compute acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["COMPUTE_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["COMPUTE_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["COMPUTE_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 COMPUTE_TEST_PROJECT=test123 COMPUTE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/compute/v1/accelerator_types/credentials" - ::Google::Cloud::Compute::V1::AcceleratorTypes::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["COMPUTE_PROJECT"] = project - ENV["COMPUTE_TEST_PROJECT"] = project - ENV["COMPUTE_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-compute 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-compute 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-compute 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-compute gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-compute" - header "google-cloud-compute rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-compute yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-compute 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-compute 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-compute 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-compute/google-cloud-compute.gemspec b/owl-bot-staging/google-cloud-compute/google-cloud-compute.gemspec deleted file mode 100644 index 7fcccd83f78f..000000000000 --- a/owl-bot-staging/google-cloud-compute/google-cloud-compute.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/compute/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-compute" - gem.version = Google::Cloud::Compute::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "google-cloud-compute is the official client library for the Google Cloud Compute API." - gem.summary = "API Client library for the Google Cloud Compute API" - 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.2" - - gem.add_dependency "google-cloud-compute-v1", "~> 2.15" - gem.add_dependency "google-cloud-core", "~> 1.6" -end diff --git a/owl-bot-staging/google-cloud-compute/lib/google-cloud-compute.rb b/owl-bot-staging/google-cloud-compute/lib/google-cloud-compute.rb deleted file mode 100644 index 5517c8d57dd6..000000000000 --- a/owl-bot-staging/google-cloud-compute/lib/google-cloud-compute.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/compute" unless defined? Google::Cloud::Compute::VERSION diff --git a/owl-bot-staging/google-cloud-compute/lib/google/cloud/compute.rb b/owl-bot-staging/google-cloud-compute/lib/google/cloud/compute.rb deleted file mode 100644 index c1ba12539164..000000000000 --- a/owl-bot-staging/google-cloud-compute/lib/google/cloud/compute.rb +++ /dev/null @@ -1,7645 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# Require this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/compute/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :compute do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module Compute - ## - # Create a new client object for AcceleratorTypes. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::AcceleratorTypes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-AcceleratorTypes-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the AcceleratorTypes service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the AcceleratorTypes service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.accelerator_types_available?}. - # - # ## About AcceleratorTypes - # - # Services - # - # The AcceleratorTypes API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.accelerator_types version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:AcceleratorTypes) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the AcceleratorTypes service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.accelerator_types}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the AcceleratorTypes service, - # or if the versioned client gem needs an update to support the AcceleratorTypes service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.accelerator_types_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :AcceleratorTypes - service_module = service_module.const_get :AcceleratorTypes - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Addresses. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Addresses::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Addresses-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Addresses service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Addresses service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.addresses_available?}. - # - # ## About Addresses - # - # The Addresses API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.addresses version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Addresses) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Addresses service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.addresses}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Addresses service, - # or if the versioned client gem needs an update to support the Addresses service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.addresses_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Addresses - service_module = service_module.const_get :Addresses - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Advice. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Advice::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Advice-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Advice service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Advice service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.advice_available?}. - # - # ## About Advice - # - # The Advice API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.advice version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Advice) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Advice service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.advice}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Advice service, - # or if the versioned client gem needs an update to support the Advice service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.advice_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Advice - service_module = service_module.const_get :Advice - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Autoscalers. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Autoscalers::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Autoscalers-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Autoscalers service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Autoscalers service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.autoscalers_available?}. - # - # ## About Autoscalers - # - # The Autoscalers API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.autoscalers version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Autoscalers) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Autoscalers service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.autoscalers}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Autoscalers service, - # or if the versioned client gem needs an update to support the Autoscalers service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.autoscalers_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Autoscalers - service_module = service_module.const_get :Autoscalers - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for BackendBuckets. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::BackendBuckets::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-BackendBuckets-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the BackendBuckets service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the BackendBuckets service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.backend_buckets_available?}. - # - # ## About BackendBuckets - # - # The BackendBuckets API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.backend_buckets version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:BackendBuckets) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the BackendBuckets service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.backend_buckets}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the BackendBuckets service, - # or if the versioned client gem needs an update to support the BackendBuckets service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.backend_buckets_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :BackendBuckets - service_module = service_module.const_get :BackendBuckets - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for BackendServices. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::BackendServices::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-BackendServices-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the BackendServices service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the BackendServices service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.backend_services_available?}. - # - # ## About BackendServices - # - # The BackendServices API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.backend_services version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:BackendServices) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the BackendServices service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.backend_services}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the BackendServices service, - # or if the versioned client gem needs an update to support the BackendServices service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.backend_services_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :BackendServices - service_module = service_module.const_get :BackendServices - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for CrossSiteNetworks. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::CrossSiteNetworks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-CrossSiteNetworks-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the CrossSiteNetworks service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the CrossSiteNetworks service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.cross_site_networks_available?}. - # - # ## About CrossSiteNetworks - # - # The CrossSiteNetworks API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.cross_site_networks version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:CrossSiteNetworks) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the CrossSiteNetworks service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.cross_site_networks}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the CrossSiteNetworks service, - # or if the versioned client gem needs an update to support the CrossSiteNetworks service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.cross_site_networks_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :CrossSiteNetworks - service_module = service_module.const_get :CrossSiteNetworks - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for DiskTypes. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::DiskTypes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-DiskTypes-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the DiskTypes service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the DiskTypes service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.disk_types_available?}. - # - # ## About DiskTypes - # - # The DiskTypes API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.disk_types version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:DiskTypes) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the DiskTypes service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.disk_types}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the DiskTypes service, - # or if the versioned client gem needs an update to support the DiskTypes service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.disk_types_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :DiskTypes - service_module = service_module.const_get :DiskTypes - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Disks. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Disks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Disks-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Disks service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Disks service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.disks_available?}. - # - # ## About Disks - # - # The Disks API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.disks version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Disks) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Disks service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.disks}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Disks service, - # or if the versioned client gem needs an update to support the Disks service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.disks_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Disks - service_module = service_module.const_get :Disks - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ExternalVpnGateways. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::ExternalVpnGateways::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ExternalVpnGateways-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ExternalVpnGateways service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the ExternalVpnGateways service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.external_vpn_gateways_available?}. - # - # ## About ExternalVpnGateways - # - # The ExternalVpnGateways API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.external_vpn_gateways version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ExternalVpnGateways) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the ExternalVpnGateways service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.external_vpn_gateways}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the ExternalVpnGateways service, - # or if the versioned client gem needs an update to support the ExternalVpnGateways service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.external_vpn_gateways_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :ExternalVpnGateways - service_module = service_module.const_get :ExternalVpnGateways - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for FirewallPolicies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::FirewallPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-FirewallPolicies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the FirewallPolicies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the FirewallPolicies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.firewall_policies_available?}. - # - # ## About FirewallPolicies - # - # The FirewallPolicies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.firewall_policies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:FirewallPolicies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the FirewallPolicies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.firewall_policies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the FirewallPolicies service, - # or if the versioned client gem needs an update to support the FirewallPolicies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.firewall_policies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :FirewallPolicies - service_module = service_module.const_get :FirewallPolicies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Firewalls. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Firewalls::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Firewalls-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Firewalls service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Firewalls service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.firewalls_available?}. - # - # ## About Firewalls - # - # The Firewalls API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.firewalls version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Firewalls) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Firewalls service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.firewalls}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Firewalls service, - # or if the versioned client gem needs an update to support the Firewalls service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.firewalls_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Firewalls - service_module = service_module.const_get :Firewalls - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ForwardingRules. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::ForwardingRules::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ForwardingRules-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ForwardingRules service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the ForwardingRules service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.forwarding_rules_available?}. - # - # ## About ForwardingRules - # - # The ForwardingRules API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.forwarding_rules version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ForwardingRules) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the ForwardingRules service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.forwarding_rules}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the ForwardingRules service, - # or if the versioned client gem needs an update to support the ForwardingRules service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.forwarding_rules_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :ForwardingRules - service_module = service_module.const_get :ForwardingRules - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for FutureReservations. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::FutureReservations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-FutureReservations-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the FutureReservations service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the FutureReservations service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.future_reservations_available?}. - # - # ## About FutureReservations - # - # The FutureReservations API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.future_reservations version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:FutureReservations) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the FutureReservations service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.future_reservations}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the FutureReservations service, - # or if the versioned client gem needs an update to support the FutureReservations service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.future_reservations_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :FutureReservations - service_module = service_module.const_get :FutureReservations - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for GlobalAddresses. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::GlobalAddresses::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-GlobalAddresses-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the GlobalAddresses service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the GlobalAddresses service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.global_addresses_available?}. - # - # ## About GlobalAddresses - # - # The GlobalAddresses API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.global_addresses version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:GlobalAddresses) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the GlobalAddresses service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.global_addresses}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the GlobalAddresses service, - # or if the versioned client gem needs an update to support the GlobalAddresses service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.global_addresses_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :GlobalAddresses - service_module = service_module.const_get :GlobalAddresses - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for GlobalForwardingRules. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::GlobalForwardingRules::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-GlobalForwardingRules-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the GlobalForwardingRules service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the GlobalForwardingRules service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.global_forwarding_rules_available?}. - # - # ## About GlobalForwardingRules - # - # The GlobalForwardingRules API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.global_forwarding_rules version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:GlobalForwardingRules) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the GlobalForwardingRules service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.global_forwarding_rules}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the GlobalForwardingRules service, - # or if the versioned client gem needs an update to support the GlobalForwardingRules service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.global_forwarding_rules_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :GlobalForwardingRules - service_module = service_module.const_get :GlobalForwardingRules - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for GlobalNetworkEndpointGroups. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::GlobalNetworkEndpointGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-GlobalNetworkEndpointGroups-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the GlobalNetworkEndpointGroups service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the GlobalNetworkEndpointGroups service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.global_network_endpoint_groups_available?}. - # - # ## About GlobalNetworkEndpointGroups - # - # The GlobalNetworkEndpointGroups API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.global_network_endpoint_groups version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:GlobalNetworkEndpointGroups) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the GlobalNetworkEndpointGroups service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.global_network_endpoint_groups}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the GlobalNetworkEndpointGroups service, - # or if the versioned client gem needs an update to support the GlobalNetworkEndpointGroups service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.global_network_endpoint_groups_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :GlobalNetworkEndpointGroups - service_module = service_module.const_get :GlobalNetworkEndpointGroups - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for GlobalOperations. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::GlobalOperations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-GlobalOperations-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the GlobalOperations service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the GlobalOperations service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.global_operations_available?}. - # - # ## About GlobalOperations - # - # The GlobalOperations API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.global_operations version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:GlobalOperations) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the GlobalOperations service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.global_operations}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the GlobalOperations service, - # or if the versioned client gem needs an update to support the GlobalOperations service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.global_operations_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :GlobalOperations - service_module = service_module.const_get :GlobalOperations - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for GlobalOrganizationOperations. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-GlobalOrganizationOperations-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the GlobalOrganizationOperations service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the GlobalOrganizationOperations service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.global_organization_operations_available?}. - # - # ## About GlobalOrganizationOperations - # - # The GlobalOrganizationOperations API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.global_organization_operations version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:GlobalOrganizationOperations) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the GlobalOrganizationOperations service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.global_organization_operations}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the GlobalOrganizationOperations service, - # or if the versioned client gem needs an update to support the GlobalOrganizationOperations service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.global_organization_operations_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :GlobalOrganizationOperations - service_module = service_module.const_get :GlobalOrganizationOperations - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for GlobalPublicDelegatedPrefixes. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::GlobalPublicDelegatedPrefixes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-GlobalPublicDelegatedPrefixes-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the GlobalPublicDelegatedPrefixes service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the GlobalPublicDelegatedPrefixes service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.global_public_delegated_prefixes_available?}. - # - # ## About GlobalPublicDelegatedPrefixes - # - # The GlobalPublicDelegatedPrefixes API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.global_public_delegated_prefixes version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:GlobalPublicDelegatedPrefixes) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the GlobalPublicDelegatedPrefixes service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.global_public_delegated_prefixes}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the GlobalPublicDelegatedPrefixes service, - # or if the versioned client gem needs an update to support the GlobalPublicDelegatedPrefixes service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.global_public_delegated_prefixes_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :GlobalPublicDelegatedPrefixes - service_module = service_module.const_get :GlobalPublicDelegatedPrefixes - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for HealthChecks. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::HealthChecks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-HealthChecks-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the HealthChecks service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the HealthChecks service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.health_checks_available?}. - # - # ## About HealthChecks - # - # The HealthChecks API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.health_checks version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:HealthChecks) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the HealthChecks service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.health_checks}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the HealthChecks service, - # or if the versioned client gem needs an update to support the HealthChecks service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.health_checks_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :HealthChecks - service_module = service_module.const_get :HealthChecks - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ImageFamilyViews. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::ImageFamilyViews::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ImageFamilyViews-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ImageFamilyViews service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the ImageFamilyViews service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.image_family_views_available?}. - # - # ## About ImageFamilyViews - # - # The ImageFamilyViews API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.image_family_views version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ImageFamilyViews) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the ImageFamilyViews service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.image_family_views}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the ImageFamilyViews service, - # or if the versioned client gem needs an update to support the ImageFamilyViews service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.image_family_views_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :ImageFamilyViews - service_module = service_module.const_get :ImageFamilyViews - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Images. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Images::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Images-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Images service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Images service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.images_available?}. - # - # ## About Images - # - # The Images API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.images version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Images) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Images service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.images}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Images service, - # or if the versioned client gem needs an update to support the Images service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.images_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Images - service_module = service_module.const_get :Images - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for InstanceGroupManagerResizeRequests. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InstanceGroupManagerResizeRequests-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the InstanceGroupManagerResizeRequests service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the InstanceGroupManagerResizeRequests service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.instance_group_manager_resize_requests_available?}. - # - # ## About InstanceGroupManagerResizeRequests - # - # The InstanceGroupManagerResizeRequests API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.instance_group_manager_resize_requests version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InstanceGroupManagerResizeRequests) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the InstanceGroupManagerResizeRequests service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instance_group_manager_resize_requests}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the InstanceGroupManagerResizeRequests service, - # or if the versioned client gem needs an update to support the InstanceGroupManagerResizeRequests service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.instance_group_manager_resize_requests_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :InstanceGroupManagerResizeRequests - service_module = service_module.const_get :InstanceGroupManagerResizeRequests - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for InstanceGroupManagers. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InstanceGroupManagers-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the InstanceGroupManagers service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the InstanceGroupManagers service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.instance_group_managers_available?}. - # - # ## About InstanceGroupManagers - # - # The InstanceGroupManagers API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.instance_group_managers version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InstanceGroupManagers) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the InstanceGroupManagers service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instance_group_managers}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the InstanceGroupManagers service, - # or if the versioned client gem needs an update to support the InstanceGroupManagers service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.instance_group_managers_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :InstanceGroupManagers - service_module = service_module.const_get :InstanceGroupManagers - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for InstanceGroups. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::InstanceGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InstanceGroups-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the InstanceGroups service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the InstanceGroups service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.instance_groups_available?}. - # - # ## About InstanceGroups - # - # The InstanceGroups API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.instance_groups version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InstanceGroups) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the InstanceGroups service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instance_groups}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the InstanceGroups service, - # or if the versioned client gem needs an update to support the InstanceGroups service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.instance_groups_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :InstanceGroups - service_module = service_module.const_get :InstanceGroups - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for InstanceSettingsService. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::InstanceSettingsService::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InstanceSettingsService-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the InstanceSettingsService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the InstanceSettingsService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.instance_settings_service_available?}. - # - # ## About InstanceSettingsService - # - # The InstanceSettings API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.instance_settings_service version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InstanceSettingsService) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the InstanceSettingsService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instance_settings_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the InstanceSettingsService service, - # or if the versioned client gem needs an update to support the InstanceSettingsService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.instance_settings_service_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :InstanceSettingsService - service_module = service_module.const_get :InstanceSettingsService - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for InstanceTemplates. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::InstanceTemplates::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InstanceTemplates-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the InstanceTemplates service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the InstanceTemplates service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.instance_templates_available?}. - # - # ## About InstanceTemplates - # - # The InstanceTemplates API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.instance_templates version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InstanceTemplates) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the InstanceTemplates service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instance_templates}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the InstanceTemplates service, - # or if the versioned client gem needs an update to support the InstanceTemplates service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.instance_templates_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :InstanceTemplates - service_module = service_module.const_get :InstanceTemplates - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Instances. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Instances::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Instances-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Instances service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Instances service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.instances_available?}. - # - # ## About Instances - # - # The Instances API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.instances version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Instances) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Instances service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instances}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Instances service, - # or if the versioned client gem needs an update to support the Instances service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.instances_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Instances - service_module = service_module.const_get :Instances - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for InstantSnapshotGroups. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::InstantSnapshotGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InstantSnapshotGroups-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the InstantSnapshotGroups service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the InstantSnapshotGroups service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.instant_snapshot_groups_available?}. - # - # ## About InstantSnapshotGroups - # - # The InstantSnapshotGroups API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.instant_snapshot_groups version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InstantSnapshotGroups) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the InstantSnapshotGroups service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instant_snapshot_groups}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the InstantSnapshotGroups service, - # or if the versioned client gem needs an update to support the InstantSnapshotGroups service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.instant_snapshot_groups_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :InstantSnapshotGroups - service_module = service_module.const_get :InstantSnapshotGroups - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for InstantSnapshots. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::InstantSnapshots::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InstantSnapshots-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the InstantSnapshots service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the InstantSnapshots service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.instant_snapshots_available?}. - # - # ## About InstantSnapshots - # - # The InstantSnapshots API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.instant_snapshots version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InstantSnapshots) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the InstantSnapshots service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.instant_snapshots}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the InstantSnapshots service, - # or if the versioned client gem needs an update to support the InstantSnapshots service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.instant_snapshots_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :InstantSnapshots - service_module = service_module.const_get :InstantSnapshots - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for InterconnectAttachmentGroups. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InterconnectAttachmentGroups-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the InterconnectAttachmentGroups service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the InterconnectAttachmentGroups service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.interconnect_attachment_groups_available?}. - # - # ## About InterconnectAttachmentGroups - # - # The InterconnectAttachmentGroups API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.interconnect_attachment_groups version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InterconnectAttachmentGroups) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the InterconnectAttachmentGroups service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.interconnect_attachment_groups}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the InterconnectAttachmentGroups service, - # or if the versioned client gem needs an update to support the InterconnectAttachmentGroups service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.interconnect_attachment_groups_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :InterconnectAttachmentGroups - service_module = service_module.const_get :InterconnectAttachmentGroups - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for InterconnectAttachments. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::InterconnectAttachments::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InterconnectAttachments-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the InterconnectAttachments service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the InterconnectAttachments service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.interconnect_attachments_available?}. - # - # ## About InterconnectAttachments - # - # The InterconnectAttachments API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.interconnect_attachments version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InterconnectAttachments) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the InterconnectAttachments service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.interconnect_attachments}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the InterconnectAttachments service, - # or if the versioned client gem needs an update to support the InterconnectAttachments service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.interconnect_attachments_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :InterconnectAttachments - service_module = service_module.const_get :InterconnectAttachments - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for InterconnectGroups. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InterconnectGroups-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the InterconnectGroups service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the InterconnectGroups service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.interconnect_groups_available?}. - # - # ## About InterconnectGroups - # - # The InterconnectGroups API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.interconnect_groups version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InterconnectGroups) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the InterconnectGroups service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.interconnect_groups}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the InterconnectGroups service, - # or if the versioned client gem needs an update to support the InterconnectGroups service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.interconnect_groups_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :InterconnectGroups - service_module = service_module.const_get :InterconnectGroups - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for InterconnectLocations. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::InterconnectLocations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InterconnectLocations-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the InterconnectLocations service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the InterconnectLocations service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.interconnect_locations_available?}. - # - # ## About InterconnectLocations - # - # The InterconnectLocations API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.interconnect_locations version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InterconnectLocations) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the InterconnectLocations service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.interconnect_locations}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the InterconnectLocations service, - # or if the versioned client gem needs an update to support the InterconnectLocations service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.interconnect_locations_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :InterconnectLocations - service_module = service_module.const_get :InterconnectLocations - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for InterconnectRemoteLocations. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::InterconnectRemoteLocations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-InterconnectRemoteLocations-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the InterconnectRemoteLocations service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the InterconnectRemoteLocations service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.interconnect_remote_locations_available?}. - # - # ## About InterconnectRemoteLocations - # - # The InterconnectRemoteLocations API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.interconnect_remote_locations version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:InterconnectRemoteLocations) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the InterconnectRemoteLocations service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.interconnect_remote_locations}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the InterconnectRemoteLocations service, - # or if the versioned client gem needs an update to support the InterconnectRemoteLocations service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.interconnect_remote_locations_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :InterconnectRemoteLocations - service_module = service_module.const_get :InterconnectRemoteLocations - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Interconnects. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Interconnects::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Interconnects-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Interconnects service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Interconnects service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.interconnects_available?}. - # - # ## About Interconnects - # - # The Interconnects API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.interconnects version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Interconnects) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Interconnects service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.interconnects}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Interconnects service, - # or if the versioned client gem needs an update to support the Interconnects service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.interconnects_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Interconnects - service_module = service_module.const_get :Interconnects - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for LicenseCodes. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::LicenseCodes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-LicenseCodes-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the LicenseCodes service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the LicenseCodes service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.license_codes_available?}. - # - # ## About LicenseCodes - # - # The LicenseCodes API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.license_codes version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:LicenseCodes) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the LicenseCodes service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.license_codes}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the LicenseCodes service, - # or if the versioned client gem needs an update to support the LicenseCodes service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.license_codes_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :LicenseCodes - service_module = service_module.const_get :LicenseCodes - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Licenses. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Licenses::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Licenses-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Licenses service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Licenses service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.licenses_available?}. - # - # ## About Licenses - # - # The Licenses API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.licenses version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Licenses) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Licenses service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.licenses}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Licenses service, - # or if the versioned client gem needs an update to support the Licenses service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.licenses_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Licenses - service_module = service_module.const_get :Licenses - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for MachineImages. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::MachineImages::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-MachineImages-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the MachineImages service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the MachineImages service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.machine_images_available?}. - # - # ## About MachineImages - # - # The MachineImages API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.machine_images version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:MachineImages) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the MachineImages service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.machine_images}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the MachineImages service, - # or if the versioned client gem needs an update to support the MachineImages service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.machine_images_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :MachineImages - service_module = service_module.const_get :MachineImages - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for MachineTypes. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::MachineTypes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-MachineTypes-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the MachineTypes service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the MachineTypes service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.machine_types_available?}. - # - # ## About MachineTypes - # - # The MachineTypes API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.machine_types version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:MachineTypes) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the MachineTypes service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.machine_types}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the MachineTypes service, - # or if the versioned client gem needs an update to support the MachineTypes service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.machine_types_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :MachineTypes - service_module = service_module.const_get :MachineTypes - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for NetworkAttachments. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::NetworkAttachments::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NetworkAttachments-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the NetworkAttachments service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the NetworkAttachments service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.network_attachments_available?}. - # - # ## About NetworkAttachments - # - # The NetworkAttachments API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.network_attachments version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NetworkAttachments) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the NetworkAttachments service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.network_attachments}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the NetworkAttachments service, - # or if the versioned client gem needs an update to support the NetworkAttachments service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.network_attachments_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :NetworkAttachments - service_module = service_module.const_get :NetworkAttachments - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for NetworkEdgeSecurityServices. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::NetworkEdgeSecurityServices::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NetworkEdgeSecurityServices-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the NetworkEdgeSecurityServices service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the NetworkEdgeSecurityServices service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.network_edge_security_services_available?}. - # - # ## About NetworkEdgeSecurityServices - # - # The NetworkEdgeSecurityServices API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.network_edge_security_services version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NetworkEdgeSecurityServices) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the NetworkEdgeSecurityServices service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.network_edge_security_services}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the NetworkEdgeSecurityServices service, - # or if the versioned client gem needs an update to support the NetworkEdgeSecurityServices service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.network_edge_security_services_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :NetworkEdgeSecurityServices - service_module = service_module.const_get :NetworkEdgeSecurityServices - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for NetworkEndpointGroups. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::NetworkEndpointGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NetworkEndpointGroups-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the NetworkEndpointGroups service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the NetworkEndpointGroups service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.network_endpoint_groups_available?}. - # - # ## About NetworkEndpointGroups - # - # The NetworkEndpointGroups API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.network_endpoint_groups version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NetworkEndpointGroups) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the NetworkEndpointGroups service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.network_endpoint_groups}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the NetworkEndpointGroups service, - # or if the versioned client gem needs an update to support the NetworkEndpointGroups service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.network_endpoint_groups_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :NetworkEndpointGroups - service_module = service_module.const_get :NetworkEndpointGroups - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for NetworkFirewallPolicies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::NetworkFirewallPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NetworkFirewallPolicies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the NetworkFirewallPolicies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the NetworkFirewallPolicies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.network_firewall_policies_available?}. - # - # ## About NetworkFirewallPolicies - # - # The NetworkFirewallPolicies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.network_firewall_policies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NetworkFirewallPolicies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the NetworkFirewallPolicies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.network_firewall_policies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the NetworkFirewallPolicies service, - # or if the versioned client gem needs an update to support the NetworkFirewallPolicies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.network_firewall_policies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :NetworkFirewallPolicies - service_module = service_module.const_get :NetworkFirewallPolicies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for NetworkProfiles. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::NetworkProfiles::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NetworkProfiles-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the NetworkProfiles service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the NetworkProfiles service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.network_profiles_available?}. - # - # ## About NetworkProfiles - # - # The NetworkProfiles API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.network_profiles version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NetworkProfiles) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the NetworkProfiles service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.network_profiles}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the NetworkProfiles service, - # or if the versioned client gem needs an update to support the NetworkProfiles service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.network_profiles_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :NetworkProfiles - service_module = service_module.const_get :NetworkProfiles - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Networks. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Networks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Networks-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Networks service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Networks service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.networks_available?}. - # - # ## About Networks - # - # The Networks API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.networks version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Networks) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Networks service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.networks}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Networks service, - # or if the versioned client gem needs an update to support the Networks service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.networks_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Networks - service_module = service_module.const_get :Networks - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for NodeGroups. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::NodeGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NodeGroups-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the NodeGroups service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the NodeGroups service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.node_groups_available?}. - # - # ## About NodeGroups - # - # The NodeGroups API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.node_groups version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NodeGroups) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the NodeGroups service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.node_groups}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the NodeGroups service, - # or if the versioned client gem needs an update to support the NodeGroups service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.node_groups_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :NodeGroups - service_module = service_module.const_get :NodeGroups - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for NodeTemplates. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::NodeTemplates::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NodeTemplates-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the NodeTemplates service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the NodeTemplates service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.node_templates_available?}. - # - # ## About NodeTemplates - # - # The NodeTemplates API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.node_templates version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NodeTemplates) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the NodeTemplates service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.node_templates}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the NodeTemplates service, - # or if the versioned client gem needs an update to support the NodeTemplates service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.node_templates_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :NodeTemplates - service_module = service_module.const_get :NodeTemplates - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for NodeTypes. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::NodeTypes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-NodeTypes-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the NodeTypes service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the NodeTypes service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.node_types_available?}. - # - # ## About NodeTypes - # - # The NodeTypes API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.node_types version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:NodeTypes) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the NodeTypes service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.node_types}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the NodeTypes service, - # or if the versioned client gem needs an update to support the NodeTypes service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.node_types_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :NodeTypes - service_module = service_module.const_get :NodeTypes - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for OrganizationSecurityPolicies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-OrganizationSecurityPolicies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the OrganizationSecurityPolicies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the OrganizationSecurityPolicies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.organization_security_policies_available?}. - # - # ## About OrganizationSecurityPolicies - # - # The OrganizationSecurityPolicies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.organization_security_policies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:OrganizationSecurityPolicies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the OrganizationSecurityPolicies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.organization_security_policies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the OrganizationSecurityPolicies service, - # or if the versioned client gem needs an update to support the OrganizationSecurityPolicies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.organization_security_policies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :OrganizationSecurityPolicies - service_module = service_module.const_get :OrganizationSecurityPolicies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for PacketMirrorings. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::PacketMirrorings::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-PacketMirrorings-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the PacketMirrorings service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the PacketMirrorings service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.packet_mirrorings_available?}. - # - # ## About PacketMirrorings - # - # The PacketMirrorings API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.packet_mirrorings version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:PacketMirrorings) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the PacketMirrorings service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.packet_mirrorings}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the PacketMirrorings service, - # or if the versioned client gem needs an update to support the PacketMirrorings service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.packet_mirrorings_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :PacketMirrorings - service_module = service_module.const_get :PacketMirrorings - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for PreviewFeatures. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::PreviewFeatures::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-PreviewFeatures-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the PreviewFeatures service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the PreviewFeatures service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.preview_features_available?}. - # - # ## About PreviewFeatures - # - # The PreviewFeatures API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.preview_features version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:PreviewFeatures) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the PreviewFeatures service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.preview_features}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the PreviewFeatures service, - # or if the versioned client gem needs an update to support the PreviewFeatures service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.preview_features_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :PreviewFeatures - service_module = service_module.const_get :PreviewFeatures - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Projects. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Projects::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Projects-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Projects service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Projects service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.projects_available?}. - # - # ## About Projects - # - # The Projects API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.projects version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Projects) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Projects service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.projects}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Projects service, - # or if the versioned client gem needs an update to support the Projects service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.projects_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Projects - service_module = service_module.const_get :Projects - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for PublicAdvertisedPrefixes. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-PublicAdvertisedPrefixes-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the PublicAdvertisedPrefixes service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the PublicAdvertisedPrefixes service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.public_advertised_prefixes_available?}. - # - # ## About PublicAdvertisedPrefixes - # - # The PublicAdvertisedPrefixes API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.public_advertised_prefixes version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:PublicAdvertisedPrefixes) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the PublicAdvertisedPrefixes service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.public_advertised_prefixes}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the PublicAdvertisedPrefixes service, - # or if the versioned client gem needs an update to support the PublicAdvertisedPrefixes service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.public_advertised_prefixes_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :PublicAdvertisedPrefixes - service_module = service_module.const_get :PublicAdvertisedPrefixes - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for PublicDelegatedPrefixes. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::PublicDelegatedPrefixes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-PublicDelegatedPrefixes-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the PublicDelegatedPrefixes service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the PublicDelegatedPrefixes service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.public_delegated_prefixes_available?}. - # - # ## About PublicDelegatedPrefixes - # - # The PublicDelegatedPrefixes API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.public_delegated_prefixes version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:PublicDelegatedPrefixes) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the PublicDelegatedPrefixes service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.public_delegated_prefixes}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the PublicDelegatedPrefixes service, - # or if the versioned client gem needs an update to support the PublicDelegatedPrefixes service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.public_delegated_prefixes_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :PublicDelegatedPrefixes - service_module = service_module.const_get :PublicDelegatedPrefixes - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionAutoscalers. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionAutoscalers::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionAutoscalers-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionAutoscalers service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionAutoscalers service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_autoscalers_available?}. - # - # ## About RegionAutoscalers - # - # The RegionAutoscalers API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_autoscalers version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionAutoscalers) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionAutoscalers service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_autoscalers}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionAutoscalers service, - # or if the versioned client gem needs an update to support the RegionAutoscalers service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_autoscalers_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionAutoscalers - service_module = service_module.const_get :RegionAutoscalers - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionBackendBuckets. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionBackendBuckets::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionBackendBuckets-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionBackendBuckets service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionBackendBuckets service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_backend_buckets_available?}. - # - # ## About RegionBackendBuckets - # - # The RegionBackendBuckets API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_backend_buckets version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionBackendBuckets) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionBackendBuckets service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_backend_buckets}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionBackendBuckets service, - # or if the versioned client gem needs an update to support the RegionBackendBuckets service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_backend_buckets_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionBackendBuckets - service_module = service_module.const_get :RegionBackendBuckets - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionBackendServices. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionBackendServices::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionBackendServices-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionBackendServices service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionBackendServices service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_backend_services_available?}. - # - # ## About RegionBackendServices - # - # The RegionBackendServices API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_backend_services version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionBackendServices) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionBackendServices service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_backend_services}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionBackendServices service, - # or if the versioned client gem needs an update to support the RegionBackendServices service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_backend_services_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionBackendServices - service_module = service_module.const_get :RegionBackendServices - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionCommitments. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionCommitments::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionCommitments-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionCommitments service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionCommitments service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_commitments_available?}. - # - # ## About RegionCommitments - # - # The RegionCommitments API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_commitments version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionCommitments) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionCommitments service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_commitments}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionCommitments service, - # or if the versioned client gem needs an update to support the RegionCommitments service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_commitments_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionCommitments - service_module = service_module.const_get :RegionCommitments - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionCompositeHealthChecks. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionCompositeHealthChecks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionCompositeHealthChecks-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionCompositeHealthChecks service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionCompositeHealthChecks service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_composite_health_checks_available?}. - # - # ## About RegionCompositeHealthChecks - # - # The RegionCompositeHealthChecks API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_composite_health_checks version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionCompositeHealthChecks) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionCompositeHealthChecks service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_composite_health_checks}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionCompositeHealthChecks service, - # or if the versioned client gem needs an update to support the RegionCompositeHealthChecks service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_composite_health_checks_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionCompositeHealthChecks - service_module = service_module.const_get :RegionCompositeHealthChecks - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionDiskTypes. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionDiskTypes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionDiskTypes-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionDiskTypes service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionDiskTypes service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_disk_types_available?}. - # - # ## About RegionDiskTypes - # - # The RegionDiskTypes API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_disk_types version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionDiskTypes) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionDiskTypes service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_disk_types}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionDiskTypes service, - # or if the versioned client gem needs an update to support the RegionDiskTypes service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_disk_types_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionDiskTypes - service_module = service_module.const_get :RegionDiskTypes - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionDisks. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionDisks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionDisks-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionDisks service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionDisks service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_disks_available?}. - # - # ## About RegionDisks - # - # The RegionDisks API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_disks version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionDisks) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionDisks service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_disks}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionDisks service, - # or if the versioned client gem needs an update to support the RegionDisks service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_disks_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionDisks - service_module = service_module.const_get :RegionDisks - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionHealthAggregationPolicies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionHealthAggregationPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionHealthAggregationPolicies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionHealthAggregationPolicies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionHealthAggregationPolicies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_health_aggregation_policies_available?}. - # - # ## About RegionHealthAggregationPolicies - # - # The RegionHealthAggregationPolicies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_health_aggregation_policies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionHealthAggregationPolicies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionHealthAggregationPolicies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_health_aggregation_policies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionHealthAggregationPolicies service, - # or if the versioned client gem needs an update to support the RegionHealthAggregationPolicies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_health_aggregation_policies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionHealthAggregationPolicies - service_module = service_module.const_get :RegionHealthAggregationPolicies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionHealthCheckServices. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionHealthCheckServices::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionHealthCheckServices-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionHealthCheckServices service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionHealthCheckServices service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_health_check_services_available?}. - # - # ## About RegionHealthCheckServices - # - # The RegionHealthCheckServices API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_health_check_services version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionHealthCheckServices) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionHealthCheckServices service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_health_check_services}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionHealthCheckServices service, - # or if the versioned client gem needs an update to support the RegionHealthCheckServices service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_health_check_services_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionHealthCheckServices - service_module = service_module.const_get :RegionHealthCheckServices - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionHealthChecks. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionHealthChecks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionHealthChecks-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionHealthChecks service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionHealthChecks service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_health_checks_available?}. - # - # ## About RegionHealthChecks - # - # The RegionHealthChecks API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_health_checks version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionHealthChecks) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionHealthChecks service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_health_checks}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionHealthChecks service, - # or if the versioned client gem needs an update to support the RegionHealthChecks service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_health_checks_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionHealthChecks - service_module = service_module.const_get :RegionHealthChecks - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionHealthSources. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionHealthSources-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionHealthSources service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionHealthSources service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_health_sources_available?}. - # - # ## About RegionHealthSources - # - # The RegionHealthSources API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_health_sources version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionHealthSources) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionHealthSources service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_health_sources}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionHealthSources service, - # or if the versioned client gem needs an update to support the RegionHealthSources service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_health_sources_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionHealthSources - service_module = service_module.const_get :RegionHealthSources - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionInstanceGroupManagerResizeRequests. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionInstanceGroupManagerResizeRequests::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstanceGroupManagerResizeRequests-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionInstanceGroupManagerResizeRequests service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionInstanceGroupManagerResizeRequests service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_instance_group_manager_resize_requests_available?}. - # - # ## About RegionInstanceGroupManagerResizeRequests - # - # The RegionInstanceGroupManagerResizeRequests API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_instance_group_manager_resize_requests version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstanceGroupManagerResizeRequests) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionInstanceGroupManagerResizeRequests service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instance_group_manager_resize_requests}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionInstanceGroupManagerResizeRequests service, - # or if the versioned client gem needs an update to support the RegionInstanceGroupManagerResizeRequests service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_instance_group_manager_resize_requests_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionInstanceGroupManagerResizeRequests - service_module = service_module.const_get :RegionInstanceGroupManagerResizeRequests - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionInstanceGroupManagers. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstanceGroupManagers-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionInstanceGroupManagers service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionInstanceGroupManagers service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_instance_group_managers_available?}. - # - # ## About RegionInstanceGroupManagers - # - # The RegionInstanceGroupManagers API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_instance_group_managers version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstanceGroupManagers) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionInstanceGroupManagers service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instance_group_managers}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionInstanceGroupManagers service, - # or if the versioned client gem needs an update to support the RegionInstanceGroupManagers service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_instance_group_managers_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionInstanceGroupManagers - service_module = service_module.const_get :RegionInstanceGroupManagers - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionInstanceGroups. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionInstanceGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstanceGroups-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionInstanceGroups service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionInstanceGroups service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_instance_groups_available?}. - # - # ## About RegionInstanceGroups - # - # The RegionInstanceGroups API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_instance_groups version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstanceGroups) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionInstanceGroups service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instance_groups}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionInstanceGroups service, - # or if the versioned client gem needs an update to support the RegionInstanceGroups service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_instance_groups_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionInstanceGroups - service_module = service_module.const_get :RegionInstanceGroups - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionInstanceTemplates. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionInstanceTemplates::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstanceTemplates-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionInstanceTemplates service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionInstanceTemplates service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_instance_templates_available?}. - # - # ## About RegionInstanceTemplates - # - # The RegionInstanceTemplates API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_instance_templates version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstanceTemplates) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionInstanceTemplates service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instance_templates}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionInstanceTemplates service, - # or if the versioned client gem needs an update to support the RegionInstanceTemplates service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_instance_templates_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionInstanceTemplates - service_module = service_module.const_get :RegionInstanceTemplates - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionInstances. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionInstances::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstances-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionInstances service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionInstances service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_instances_available?}. - # - # ## About RegionInstances - # - # The RegionInstances API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_instances version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstances) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionInstances service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instances}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionInstances service, - # or if the versioned client gem needs an update to support the RegionInstances service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_instances_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionInstances - service_module = service_module.const_get :RegionInstances - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionInstantSnapshotGroups. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionInstantSnapshotGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstantSnapshotGroups-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionInstantSnapshotGroups service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionInstantSnapshotGroups service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_instant_snapshot_groups_available?}. - # - # ## About RegionInstantSnapshotGroups - # - # The RegionInstantSnapshotGroups API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_instant_snapshot_groups version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstantSnapshotGroups) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionInstantSnapshotGroups service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instant_snapshot_groups}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionInstantSnapshotGroups service, - # or if the versioned client gem needs an update to support the RegionInstantSnapshotGroups service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_instant_snapshot_groups_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionInstantSnapshotGroups - service_module = service_module.const_get :RegionInstantSnapshotGroups - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionInstantSnapshots. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionInstantSnapshots::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionInstantSnapshots-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionInstantSnapshots service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionInstantSnapshots service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_instant_snapshots_available?}. - # - # ## About RegionInstantSnapshots - # - # The RegionInstantSnapshots API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_instant_snapshots version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionInstantSnapshots) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionInstantSnapshots service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_instant_snapshots}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionInstantSnapshots service, - # or if the versioned client gem needs an update to support the RegionInstantSnapshots service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_instant_snapshots_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionInstantSnapshots - service_module = service_module.const_get :RegionInstantSnapshots - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionNetworkEndpointGroups. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionNetworkEndpointGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionNetworkEndpointGroups-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionNetworkEndpointGroups service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionNetworkEndpointGroups service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_network_endpoint_groups_available?}. - # - # ## About RegionNetworkEndpointGroups - # - # The RegionNetworkEndpointGroups API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_network_endpoint_groups version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionNetworkEndpointGroups) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionNetworkEndpointGroups service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_network_endpoint_groups}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionNetworkEndpointGroups service, - # or if the versioned client gem needs an update to support the RegionNetworkEndpointGroups service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_network_endpoint_groups_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionNetworkEndpointGroups - service_module = service_module.const_get :RegionNetworkEndpointGroups - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionNetworkFirewallPolicies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionNetworkFirewallPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionNetworkFirewallPolicies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionNetworkFirewallPolicies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionNetworkFirewallPolicies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_network_firewall_policies_available?}. - # - # ## About RegionNetworkFirewallPolicies - # - # The RegionNetworkFirewallPolicies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_network_firewall_policies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionNetworkFirewallPolicies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionNetworkFirewallPolicies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_network_firewall_policies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionNetworkFirewallPolicies service, - # or if the versioned client gem needs an update to support the RegionNetworkFirewallPolicies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_network_firewall_policies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionNetworkFirewallPolicies - service_module = service_module.const_get :RegionNetworkFirewallPolicies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionNotificationEndpoints. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionNotificationEndpoints::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionNotificationEndpoints-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionNotificationEndpoints service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionNotificationEndpoints service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_notification_endpoints_available?}. - # - # ## About RegionNotificationEndpoints - # - # The RegionNotificationEndpoints API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_notification_endpoints version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionNotificationEndpoints) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionNotificationEndpoints service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_notification_endpoints}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionNotificationEndpoints service, - # or if the versioned client gem needs an update to support the RegionNotificationEndpoints service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_notification_endpoints_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionNotificationEndpoints - service_module = service_module.const_get :RegionNotificationEndpoints - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionOperations. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionOperations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionOperations-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionOperations service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionOperations service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_operations_available?}. - # - # ## About RegionOperations - # - # The RegionOperations API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_operations version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionOperations) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionOperations service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_operations}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionOperations service, - # or if the versioned client gem needs an update to support the RegionOperations service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_operations_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionOperations - service_module = service_module.const_get :RegionOperations - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionSecurityPolicies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionSecurityPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionSecurityPolicies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionSecurityPolicies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionSecurityPolicies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_security_policies_available?}. - # - # ## About RegionSecurityPolicies - # - # The RegionSecurityPolicies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_security_policies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionSecurityPolicies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionSecurityPolicies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_security_policies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionSecurityPolicies service, - # or if the versioned client gem needs an update to support the RegionSecurityPolicies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_security_policies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionSecurityPolicies - service_module = service_module.const_get :RegionSecurityPolicies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionSnapshotSettings. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionSnapshotSettings-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionSnapshotSettings service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionSnapshotSettings service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_snapshot_settings_available?}. - # - # ## About RegionSnapshotSettings - # - # The RegionSnapshotSettings API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_snapshot_settings version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionSnapshotSettings) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionSnapshotSettings service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_snapshot_settings}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionSnapshotSettings service, - # or if the versioned client gem needs an update to support the RegionSnapshotSettings service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_snapshot_settings_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionSnapshotSettings - service_module = service_module.const_get :RegionSnapshotSettings - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionSnapshots. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionSnapshots::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionSnapshots-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionSnapshots service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionSnapshots service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_snapshots_available?}. - # - # ## About RegionSnapshots - # - # The RegionSnapshots API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_snapshots version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionSnapshots) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionSnapshots service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_snapshots}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionSnapshots service, - # or if the versioned client gem needs an update to support the RegionSnapshots service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_snapshots_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionSnapshots - service_module = service_module.const_get :RegionSnapshots - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionSslCertificates. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionSslCertificates::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionSslCertificates-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionSslCertificates service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionSslCertificates service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_ssl_certificates_available?}. - # - # ## About RegionSslCertificates - # - # The RegionSslCertificates API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_ssl_certificates version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionSslCertificates) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionSslCertificates service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_ssl_certificates}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionSslCertificates service, - # or if the versioned client gem needs an update to support the RegionSslCertificates service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_ssl_certificates_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionSslCertificates - service_module = service_module.const_get :RegionSslCertificates - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionSslPolicies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionSslPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionSslPolicies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionSslPolicies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionSslPolicies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_ssl_policies_available?}. - # - # ## About RegionSslPolicies - # - # The RegionSslPolicies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_ssl_policies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionSslPolicies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionSslPolicies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_ssl_policies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionSslPolicies service, - # or if the versioned client gem needs an update to support the RegionSslPolicies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_ssl_policies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionSslPolicies - service_module = service_module.const_get :RegionSslPolicies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionTargetHttpProxies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionTargetHttpProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionTargetHttpProxies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionTargetHttpProxies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionTargetHttpProxies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_target_http_proxies_available?}. - # - # ## About RegionTargetHttpProxies - # - # The RegionTargetHttpProxies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_target_http_proxies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionTargetHttpProxies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionTargetHttpProxies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_target_http_proxies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionTargetHttpProxies service, - # or if the versioned client gem needs an update to support the RegionTargetHttpProxies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_target_http_proxies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionTargetHttpProxies - service_module = service_module.const_get :RegionTargetHttpProxies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionTargetHttpsProxies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionTargetHttpsProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionTargetHttpsProxies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionTargetHttpsProxies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionTargetHttpsProxies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_target_https_proxies_available?}. - # - # ## About RegionTargetHttpsProxies - # - # The RegionTargetHttpsProxies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_target_https_proxies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionTargetHttpsProxies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionTargetHttpsProxies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_target_https_proxies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionTargetHttpsProxies service, - # or if the versioned client gem needs an update to support the RegionTargetHttpsProxies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_target_https_proxies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionTargetHttpsProxies - service_module = service_module.const_get :RegionTargetHttpsProxies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionTargetTcpProxies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionTargetTcpProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionTargetTcpProxies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionTargetTcpProxies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionTargetTcpProxies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_target_tcp_proxies_available?}. - # - # ## About RegionTargetTcpProxies - # - # The RegionTargetTcpProxies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_target_tcp_proxies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionTargetTcpProxies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionTargetTcpProxies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_target_tcp_proxies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionTargetTcpProxies service, - # or if the versioned client gem needs an update to support the RegionTargetTcpProxies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_target_tcp_proxies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionTargetTcpProxies - service_module = service_module.const_get :RegionTargetTcpProxies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionUrlMaps. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionUrlMaps::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionUrlMaps-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionUrlMaps service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionUrlMaps service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_url_maps_available?}. - # - # ## About RegionUrlMaps - # - # The RegionUrlMaps API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_url_maps version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionUrlMaps) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionUrlMaps service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_url_maps}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionUrlMaps service, - # or if the versioned client gem needs an update to support the RegionUrlMaps service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_url_maps_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionUrlMaps - service_module = service_module.const_get :RegionUrlMaps - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for RegionZones. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::RegionZones::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-RegionZones-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the RegionZones service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the RegionZones service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.region_zones_available?}. - # - # ## About RegionZones - # - # The RegionZones API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.region_zones version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:RegionZones) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the RegionZones service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.region_zones}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RegionZones service, - # or if the versioned client gem needs an update to support the RegionZones service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.region_zones_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :RegionZones - service_module = service_module.const_get :RegionZones - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Regions. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Regions::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Regions-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Regions service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Regions service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.regions_available?}. - # - # ## About Regions - # - # The Regions API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.regions version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Regions) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Regions service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.regions}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Regions service, - # or if the versioned client gem needs an update to support the Regions service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.regions_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Regions - service_module = service_module.const_get :Regions - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ReservationBlocks. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ReservationBlocks-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ReservationBlocks service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the ReservationBlocks service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.reservation_blocks_available?}. - # - # ## About ReservationBlocks - # - # The ReservationBlocks API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.reservation_blocks version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ReservationBlocks) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the ReservationBlocks service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.reservation_blocks}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the ReservationBlocks service, - # or if the versioned client gem needs an update to support the ReservationBlocks service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.reservation_blocks_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :ReservationBlocks - service_module = service_module.const_get :ReservationBlocks - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ReservationSlots. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::ReservationSlots::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ReservationSlots-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ReservationSlots service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the ReservationSlots service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.reservation_slots_available?}. - # - # ## About ReservationSlots - # - # The ReservationSlots API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.reservation_slots version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ReservationSlots) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the ReservationSlots service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.reservation_slots}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the ReservationSlots service, - # or if the versioned client gem needs an update to support the ReservationSlots service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.reservation_slots_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :ReservationSlots - service_module = service_module.const_get :ReservationSlots - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ReservationSubBlocks. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::ReservationSubBlocks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ReservationSubBlocks-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ReservationSubBlocks service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the ReservationSubBlocks service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.reservation_sub_blocks_available?}. - # - # ## About ReservationSubBlocks - # - # The ReservationSubBlocks API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.reservation_sub_blocks version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ReservationSubBlocks) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the ReservationSubBlocks service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.reservation_sub_blocks}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the ReservationSubBlocks service, - # or if the versioned client gem needs an update to support the ReservationSubBlocks service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.reservation_sub_blocks_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :ReservationSubBlocks - service_module = service_module.const_get :ReservationSubBlocks - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Reservations. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Reservations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Reservations-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Reservations service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Reservations service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.reservations_available?}. - # - # ## About Reservations - # - # The Reservations API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.reservations version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Reservations) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Reservations service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.reservations}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Reservations service, - # or if the versioned client gem needs an update to support the Reservations service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.reservations_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Reservations - service_module = service_module.const_get :Reservations - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ResourcePolicies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::ResourcePolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ResourcePolicies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ResourcePolicies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the ResourcePolicies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.resource_policies_available?}. - # - # ## About ResourcePolicies - # - # The ResourcePolicies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.resource_policies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ResourcePolicies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the ResourcePolicies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.resource_policies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the ResourcePolicies service, - # or if the versioned client gem needs an update to support the ResourcePolicies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.resource_policies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :ResourcePolicies - service_module = service_module.const_get :ResourcePolicies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Routers. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Routers::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Routers-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Routers service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Routers service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.routers_available?}. - # - # ## About Routers - # - # The Routers API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.routers version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Routers) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Routers service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.routers}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Routers service, - # or if the versioned client gem needs an update to support the Routers service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.routers_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Routers - service_module = service_module.const_get :Routers - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Routes. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Routes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Routes-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Routes service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Routes service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.routes_available?}. - # - # ## About Routes - # - # The Routes API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.routes version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Routes) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Routes service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.routes}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Routes service, - # or if the versioned client gem needs an update to support the Routes service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.routes_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Routes - service_module = service_module.const_get :Routes - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for SecurityPolicies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-SecurityPolicies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the SecurityPolicies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the SecurityPolicies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.security_policies_available?}. - # - # ## About SecurityPolicies - # - # The SecurityPolicies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.security_policies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:SecurityPolicies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the SecurityPolicies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.security_policies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the SecurityPolicies service, - # or if the versioned client gem needs an update to support the SecurityPolicies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.security_policies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :SecurityPolicies - service_module = service_module.const_get :SecurityPolicies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ServiceAttachments. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::ServiceAttachments::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ServiceAttachments-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ServiceAttachments service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the ServiceAttachments service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.service_attachments_available?}. - # - # ## About ServiceAttachments - # - # The ServiceAttachments API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.service_attachments version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ServiceAttachments) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the ServiceAttachments service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.service_attachments}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the ServiceAttachments service, - # or if the versioned client gem needs an update to support the ServiceAttachments service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.service_attachments_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :ServiceAttachments - service_module = service_module.const_get :ServiceAttachments - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for SnapshotSettingsService. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::SnapshotSettingsService::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-SnapshotSettingsService-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the SnapshotSettingsService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the SnapshotSettingsService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.snapshot_settings_service_available?}. - # - # ## About SnapshotSettingsService - # - # The SnapshotSettings API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.snapshot_settings_service version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:SnapshotSettingsService) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the SnapshotSettingsService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.snapshot_settings_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the SnapshotSettingsService service, - # or if the versioned client gem needs an update to support the SnapshotSettingsService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.snapshot_settings_service_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :SnapshotSettingsService - service_module = service_module.const_get :SnapshotSettingsService - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Snapshots. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Snapshots::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Snapshots-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Snapshots service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Snapshots service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.snapshots_available?}. - # - # ## About Snapshots - # - # The Snapshots API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.snapshots version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Snapshots) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Snapshots service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.snapshots}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Snapshots service, - # or if the versioned client gem needs an update to support the Snapshots service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.snapshots_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Snapshots - service_module = service_module.const_get :Snapshots - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for SslCertificates. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::SslCertificates::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-SslCertificates-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the SslCertificates service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the SslCertificates service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.ssl_certificates_available?}. - # - # ## About SslCertificates - # - # The SslCertificates API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.ssl_certificates version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:SslCertificates) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the SslCertificates service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.ssl_certificates}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the SslCertificates service, - # or if the versioned client gem needs an update to support the SslCertificates service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.ssl_certificates_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :SslCertificates - service_module = service_module.const_get :SslCertificates - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for SslPolicies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::SslPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-SslPolicies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the SslPolicies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the SslPolicies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.ssl_policies_available?}. - # - # ## About SslPolicies - # - # The SslPolicies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.ssl_policies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:SslPolicies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the SslPolicies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.ssl_policies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the SslPolicies service, - # or if the versioned client gem needs an update to support the SslPolicies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.ssl_policies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :SslPolicies - service_module = service_module.const_get :SslPolicies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for StoragePoolTypes. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::StoragePoolTypes::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-StoragePoolTypes-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the StoragePoolTypes service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the StoragePoolTypes service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.storage_pool_types_available?}. - # - # ## About StoragePoolTypes - # - # The StoragePoolTypes API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.storage_pool_types version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:StoragePoolTypes) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the StoragePoolTypes service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.storage_pool_types}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the StoragePoolTypes service, - # or if the versioned client gem needs an update to support the StoragePoolTypes service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.storage_pool_types_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :StoragePoolTypes - service_module = service_module.const_get :StoragePoolTypes - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for StoragePools. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::StoragePools::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-StoragePools-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the StoragePools service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the StoragePools service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.storage_pools_available?}. - # - # ## About StoragePools - # - # The StoragePools API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.storage_pools version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:StoragePools) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the StoragePools service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.storage_pools}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the StoragePools service, - # or if the versioned client gem needs an update to support the StoragePools service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.storage_pools_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :StoragePools - service_module = service_module.const_get :StoragePools - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Subnetworks. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Subnetworks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Subnetworks-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Subnetworks service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Subnetworks service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.subnetworks_available?}. - # - # ## About Subnetworks - # - # The Subnetworks API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.subnetworks version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Subnetworks) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Subnetworks service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.subnetworks}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Subnetworks service, - # or if the versioned client gem needs an update to support the Subnetworks service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.subnetworks_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Subnetworks - service_module = service_module.const_get :Subnetworks - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for TargetGrpcProxies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::TargetGrpcProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetGrpcProxies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TargetGrpcProxies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the TargetGrpcProxies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.target_grpc_proxies_available?}. - # - # ## About TargetGrpcProxies - # - # The TargetGrpcProxies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.target_grpc_proxies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetGrpcProxies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the TargetGrpcProxies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_grpc_proxies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TargetGrpcProxies service, - # or if the versioned client gem needs an update to support the TargetGrpcProxies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.target_grpc_proxies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :TargetGrpcProxies - service_module = service_module.const_get :TargetGrpcProxies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for TargetHttpProxies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::TargetHttpProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetHttpProxies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TargetHttpProxies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the TargetHttpProxies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.target_http_proxies_available?}. - # - # ## About TargetHttpProxies - # - # The TargetHttpProxies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.target_http_proxies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetHttpProxies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the TargetHttpProxies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_http_proxies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TargetHttpProxies service, - # or if the versioned client gem needs an update to support the TargetHttpProxies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.target_http_proxies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :TargetHttpProxies - service_module = service_module.const_get :TargetHttpProxies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for TargetHttpsProxies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::TargetHttpsProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetHttpsProxies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TargetHttpsProxies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the TargetHttpsProxies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.target_https_proxies_available?}. - # - # ## About TargetHttpsProxies - # - # The TargetHttpsProxies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.target_https_proxies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetHttpsProxies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the TargetHttpsProxies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_https_proxies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TargetHttpsProxies service, - # or if the versioned client gem needs an update to support the TargetHttpsProxies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.target_https_proxies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :TargetHttpsProxies - service_module = service_module.const_get :TargetHttpsProxies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for TargetInstances. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::TargetInstances::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetInstances-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TargetInstances service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the TargetInstances service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.target_instances_available?}. - # - # ## About TargetInstances - # - # The TargetInstances API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.target_instances version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetInstances) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the TargetInstances service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_instances}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TargetInstances service, - # or if the versioned client gem needs an update to support the TargetInstances service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.target_instances_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :TargetInstances - service_module = service_module.const_get :TargetInstances - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for TargetPools. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::TargetPools::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetPools-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TargetPools service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the TargetPools service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.target_pools_available?}. - # - # ## About TargetPools - # - # The TargetPools API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.target_pools version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetPools) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the TargetPools service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_pools}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TargetPools service, - # or if the versioned client gem needs an update to support the TargetPools service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.target_pools_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :TargetPools - service_module = service_module.const_get :TargetPools - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for TargetSslProxies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::TargetSslProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetSslProxies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TargetSslProxies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the TargetSslProxies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.target_ssl_proxies_available?}. - # - # ## About TargetSslProxies - # - # The TargetSslProxies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.target_ssl_proxies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetSslProxies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the TargetSslProxies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_ssl_proxies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TargetSslProxies service, - # or if the versioned client gem needs an update to support the TargetSslProxies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.target_ssl_proxies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :TargetSslProxies - service_module = service_module.const_get :TargetSslProxies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for TargetTcpProxies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::TargetTcpProxies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetTcpProxies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TargetTcpProxies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the TargetTcpProxies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.target_tcp_proxies_available?}. - # - # ## About TargetTcpProxies - # - # The TargetTcpProxies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.target_tcp_proxies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetTcpProxies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the TargetTcpProxies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_tcp_proxies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TargetTcpProxies service, - # or if the versioned client gem needs an update to support the TargetTcpProxies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.target_tcp_proxies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :TargetTcpProxies - service_module = service_module.const_get :TargetTcpProxies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for TargetVpnGateways. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::TargetVpnGateways::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-TargetVpnGateways-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TargetVpnGateways service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the TargetVpnGateways service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.target_vpn_gateways_available?}. - # - # ## About TargetVpnGateways - # - # The TargetVpnGateways API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.target_vpn_gateways version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:TargetVpnGateways) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the TargetVpnGateways service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.target_vpn_gateways}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TargetVpnGateways service, - # or if the versioned client gem needs an update to support the TargetVpnGateways service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.target_vpn_gateways_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :TargetVpnGateways - service_module = service_module.const_get :TargetVpnGateways - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for UrlMaps. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::UrlMaps::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-UrlMaps-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the UrlMaps service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the UrlMaps service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.url_maps_available?}. - # - # ## About UrlMaps - # - # The UrlMaps API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.url_maps version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:UrlMaps) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the UrlMaps service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.url_maps}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the UrlMaps service, - # or if the versioned client gem needs an update to support the UrlMaps service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.url_maps_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :UrlMaps - service_module = service_module.const_get :UrlMaps - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for VpnGateways. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::VpnGateways::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-VpnGateways-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the VpnGateways service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the VpnGateways service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.vpn_gateways_available?}. - # - # ## About VpnGateways - # - # The VpnGateways API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.vpn_gateways version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:VpnGateways) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the VpnGateways service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.vpn_gateways}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the VpnGateways service, - # or if the versioned client gem needs an update to support the VpnGateways service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.vpn_gateways_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :VpnGateways - service_module = service_module.const_get :VpnGateways - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for VpnTunnels. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::VpnTunnels::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-VpnTunnels-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the VpnTunnels service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the VpnTunnels service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.vpn_tunnels_available?}. - # - # ## About VpnTunnels - # - # The VpnTunnels API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.vpn_tunnels version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:VpnTunnels) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the VpnTunnels service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.vpn_tunnels}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the VpnTunnels service, - # or if the versioned client gem needs an update to support the VpnTunnels service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.vpn_tunnels_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :VpnTunnels - service_module = service_module.const_get :VpnTunnels - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for WireGroups. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::WireGroups::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-WireGroups-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the WireGroups service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the WireGroups service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.wire_groups_available?}. - # - # ## About WireGroups - # - # The WireGroups API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.wire_groups version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:WireGroups) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the WireGroups service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.wire_groups}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the WireGroups service, - # or if the versioned client gem needs an update to support the WireGroups service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.wire_groups_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :WireGroups - service_module = service_module.const_get :WireGroups - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ZoneOperations. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::ZoneOperations::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ZoneOperations-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ZoneOperations service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the ZoneOperations service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.zone_operations_available?}. - # - # ## About ZoneOperations - # - # The ZoneOperations API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.zone_operations version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ZoneOperations) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the ZoneOperations service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.zone_operations}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the ZoneOperations service, - # or if the versioned client gem needs an update to support the ZoneOperations service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.zone_operations_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :ZoneOperations - service_module = service_module.const_get :ZoneOperations - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ZoneVmExtensionPolicies. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::ZoneVmExtensionPolicies::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ZoneVmExtensionPolicies-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ZoneVmExtensionPolicies service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the ZoneVmExtensionPolicies service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.zone_vm_extension_policies_available?}. - # - # ## About ZoneVmExtensionPolicies - # - # The ZoneVmExtensionPolicies API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.zone_vm_extension_policies version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ZoneVmExtensionPolicies) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the ZoneVmExtensionPolicies service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.zone_vm_extension_policies}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the ZoneVmExtensionPolicies service, - # or if the versioned client gem needs an update to support the ZoneVmExtensionPolicies service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.zone_vm_extension_policies_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :ZoneVmExtensionPolicies - service_module = service_module.const_get :ZoneVmExtensionPolicies - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Zones. - # - # By default, this returns an instance of - # [Google::Cloud::Compute::V1::Zones::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-Zones-Rest-Client) - # for a REST client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Zones service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Zones service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Compute.zones_available?}. - # - # ## About Zones - # - # The Zones API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.zones version: :v1, &block - require "google/cloud/compute/#{version.to_s.downcase}" - - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Compute.const_get(package_name).const_get(:Zones) - service_module.const_get(:Rest).const_get(:Client).new(&block) - end - - ## - # Determines whether the Zones service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Compute.zones}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Zones service, - # or if the versioned client gem needs an update to support the Zones service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.zones_available? version: :v1 - require "google/cloud/compute/#{version.to_s.downcase}" - package_name = Google::Cloud::Compute - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Compute.const_get package_name - return false unless service_module.const_defined? :Zones - service_module = service_module.const_get :Zones - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-compute library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # 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 [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.compute if block_given? - - ::Google::Cloud.configure.compute - end - end - end -end - -helper_path = ::File.join __dir__, "compute", "helpers.rb" -require "google/cloud/compute/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-compute/lib/google/cloud/compute/version.rb b/owl-bot-staging/google-cloud-compute/lib/google/cloud/compute/version.rb deleted file mode 100644 index 741d4efe47a7..000000000000 --- a/owl-bot-staging/google-cloud-compute/lib/google/cloud/compute/version.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Compute - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-compute/test/google/cloud/compute/client_test.rb b/owl-bot-staging/google-cloud-compute/test/google/cloud/compute/client_test.rb deleted file mode 100644 index 9c7fe7e2961e..000000000000 --- a/owl-bot-staging/google-cloud-compute/test/google/cloud/compute/client_test.rb +++ /dev/null @@ -1,1242 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "google/cloud/compute" -require "gapic/common" -require "gapic/rest" - -class Google::Cloud::Compute::ClientConstructionMinitest < 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_accelerator_types_rest - skip unless Google::Cloud::Compute.accelerator_types_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.accelerator_types do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::AcceleratorTypes::Rest::Client, client - end - end - - def test_addresses_rest - skip unless Google::Cloud::Compute.addresses_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.addresses do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Addresses::Rest::Client, client - end - end - - def test_advice_rest - skip unless Google::Cloud::Compute.advice_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.advice do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Advice::Rest::Client, client - end - end - - def test_autoscalers_rest - skip unless Google::Cloud::Compute.autoscalers_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.autoscalers do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Autoscalers::Rest::Client, client - end - end - - def test_backend_buckets_rest - skip unless Google::Cloud::Compute.backend_buckets_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.backend_buckets do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::BackendBuckets::Rest::Client, client - end - end - - def test_backend_services_rest - skip unless Google::Cloud::Compute.backend_services_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.backend_services do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::BackendServices::Rest::Client, client - end - end - - def test_cross_site_networks_rest - skip unless Google::Cloud::Compute.cross_site_networks_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.cross_site_networks do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::CrossSiteNetworks::Rest::Client, client - end - end - - def test_disk_types_rest - skip unless Google::Cloud::Compute.disk_types_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.disk_types do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::DiskTypes::Rest::Client, client - end - end - - def test_disks_rest - skip unless Google::Cloud::Compute.disks_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.disks do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Disks::Rest::Client, client - end - end - - def test_external_vpn_gateways_rest - skip unless Google::Cloud::Compute.external_vpn_gateways_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.external_vpn_gateways do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::ExternalVpnGateways::Rest::Client, client - end - end - - def test_firewall_policies_rest - skip unless Google::Cloud::Compute.firewall_policies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.firewall_policies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::FirewallPolicies::Rest::Client, client - end - end - - def test_firewalls_rest - skip unless Google::Cloud::Compute.firewalls_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.firewalls do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Firewalls::Rest::Client, client - end - end - - def test_forwarding_rules_rest - skip unless Google::Cloud::Compute.forwarding_rules_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.forwarding_rules do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::ForwardingRules::Rest::Client, client - end - end - - def test_future_reservations_rest - skip unless Google::Cloud::Compute.future_reservations_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.future_reservations do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::FutureReservations::Rest::Client, client - end - end - - def test_global_addresses_rest - skip unless Google::Cloud::Compute.global_addresses_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.global_addresses do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::GlobalAddresses::Rest::Client, client - end - end - - def test_global_forwarding_rules_rest - skip unless Google::Cloud::Compute.global_forwarding_rules_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.global_forwarding_rules do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::GlobalForwardingRules::Rest::Client, client - end - end - - def test_global_network_endpoint_groups_rest - skip unless Google::Cloud::Compute.global_network_endpoint_groups_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.global_network_endpoint_groups do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::GlobalNetworkEndpointGroups::Rest::Client, client - end - end - - def test_global_operations_rest - skip unless Google::Cloud::Compute.global_operations_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.global_operations do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::GlobalOperations::Rest::Client, client - end - end - - def test_global_organization_operations_rest - skip unless Google::Cloud::Compute.global_organization_operations_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.global_organization_operations do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::Client, client - end - end - - def test_global_public_delegated_prefixes_rest - skip unless Google::Cloud::Compute.global_public_delegated_prefixes_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.global_public_delegated_prefixes do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::GlobalPublicDelegatedPrefixes::Rest::Client, client - end - end - - def test_health_checks_rest - skip unless Google::Cloud::Compute.health_checks_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.health_checks do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::HealthChecks::Rest::Client, client - end - end - - def test_image_family_views_rest - skip unless Google::Cloud::Compute.image_family_views_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.image_family_views do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::ImageFamilyViews::Rest::Client, client - end - end - - def test_images_rest - skip unless Google::Cloud::Compute.images_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.images do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Images::Rest::Client, client - end - end - - def test_instance_group_manager_resize_requests_rest - skip unless Google::Cloud::Compute.instance_group_manager_resize_requests_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.instance_group_manager_resize_requests do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::InstanceGroupManagerResizeRequests::Rest::Client, client - end - end - - def test_instance_group_managers_rest - skip unless Google::Cloud::Compute.instance_group_managers_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.instance_group_managers do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client, client - end - end - - def test_instance_groups_rest - skip unless Google::Cloud::Compute.instance_groups_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.instance_groups do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::InstanceGroups::Rest::Client, client - end - end - - def test_instance_settings_service_rest - skip unless Google::Cloud::Compute.instance_settings_service_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.instance_settings_service do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::InstanceSettingsService::Rest::Client, client - end - end - - def test_instance_templates_rest - skip unless Google::Cloud::Compute.instance_templates_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.instance_templates do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::InstanceTemplates::Rest::Client, client - end - end - - def test_instances_rest - skip unless Google::Cloud::Compute.instances_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.instances do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Instances::Rest::Client, client - end - end - - def test_instant_snapshot_groups_rest - skip unless Google::Cloud::Compute.instant_snapshot_groups_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.instant_snapshot_groups do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::InstantSnapshotGroups::Rest::Client, client - end - end - - def test_instant_snapshots_rest - skip unless Google::Cloud::Compute.instant_snapshots_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.instant_snapshots do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::InstantSnapshots::Rest::Client, client - end - end - - def test_interconnect_attachment_groups_rest - skip unless Google::Cloud::Compute.interconnect_attachment_groups_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.interconnect_attachment_groups do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::InterconnectAttachmentGroups::Rest::Client, client - end - end - - def test_interconnect_attachments_rest - skip unless Google::Cloud::Compute.interconnect_attachments_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.interconnect_attachments do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::InterconnectAttachments::Rest::Client, client - end - end - - def test_interconnect_groups_rest - skip unless Google::Cloud::Compute.interconnect_groups_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.interconnect_groups do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::InterconnectGroups::Rest::Client, client - end - end - - def test_interconnect_locations_rest - skip unless Google::Cloud::Compute.interconnect_locations_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.interconnect_locations do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::InterconnectLocations::Rest::Client, client - end - end - - def test_interconnect_remote_locations_rest - skip unless Google::Cloud::Compute.interconnect_remote_locations_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.interconnect_remote_locations do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::InterconnectRemoteLocations::Rest::Client, client - end - end - - def test_interconnects_rest - skip unless Google::Cloud::Compute.interconnects_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.interconnects do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Interconnects::Rest::Client, client - end - end - - def test_license_codes_rest - skip unless Google::Cloud::Compute.license_codes_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.license_codes do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::LicenseCodes::Rest::Client, client - end - end - - def test_licenses_rest - skip unless Google::Cloud::Compute.licenses_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.licenses do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Licenses::Rest::Client, client - end - end - - def test_machine_images_rest - skip unless Google::Cloud::Compute.machine_images_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.machine_images do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::MachineImages::Rest::Client, client - end - end - - def test_machine_types_rest - skip unless Google::Cloud::Compute.machine_types_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.machine_types do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::MachineTypes::Rest::Client, client - end - end - - def test_network_attachments_rest - skip unless Google::Cloud::Compute.network_attachments_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.network_attachments do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::NetworkAttachments::Rest::Client, client - end - end - - def test_network_edge_security_services_rest - skip unless Google::Cloud::Compute.network_edge_security_services_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.network_edge_security_services do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::NetworkEdgeSecurityServices::Rest::Client, client - end - end - - def test_network_endpoint_groups_rest - skip unless Google::Cloud::Compute.network_endpoint_groups_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.network_endpoint_groups do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::NetworkEndpointGroups::Rest::Client, client - end - end - - def test_network_firewall_policies_rest - skip unless Google::Cloud::Compute.network_firewall_policies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.network_firewall_policies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::NetworkFirewallPolicies::Rest::Client, client - end - end - - def test_network_profiles_rest - skip unless Google::Cloud::Compute.network_profiles_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.network_profiles do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::NetworkProfiles::Rest::Client, client - end - end - - def test_networks_rest - skip unless Google::Cloud::Compute.networks_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.networks do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Networks::Rest::Client, client - end - end - - def test_node_groups_rest - skip unless Google::Cloud::Compute.node_groups_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.node_groups do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::NodeGroups::Rest::Client, client - end - end - - def test_node_templates_rest - skip unless Google::Cloud::Compute.node_templates_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.node_templates do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::NodeTemplates::Rest::Client, client - end - end - - def test_node_types_rest - skip unless Google::Cloud::Compute.node_types_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.node_types do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::NodeTypes::Rest::Client, client - end - end - - def test_organization_security_policies_rest - skip unless Google::Cloud::Compute.organization_security_policies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.organization_security_policies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::OrganizationSecurityPolicies::Rest::Client, client - end - end - - def test_packet_mirrorings_rest - skip unless Google::Cloud::Compute.packet_mirrorings_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.packet_mirrorings do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::PacketMirrorings::Rest::Client, client - end - end - - def test_preview_features_rest - skip unless Google::Cloud::Compute.preview_features_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.preview_features do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::PreviewFeatures::Rest::Client, client - end - end - - def test_projects_rest - skip unless Google::Cloud::Compute.projects_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.projects do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Projects::Rest::Client, client - end - end - - def test_public_advertised_prefixes_rest - skip unless Google::Cloud::Compute.public_advertised_prefixes_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.public_advertised_prefixes do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client, client - end - end - - def test_public_delegated_prefixes_rest - skip unless Google::Cloud::Compute.public_delegated_prefixes_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.public_delegated_prefixes do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::PublicDelegatedPrefixes::Rest::Client, client - end - end - - def test_region_autoscalers_rest - skip unless Google::Cloud::Compute.region_autoscalers_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_autoscalers do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionAutoscalers::Rest::Client, client - end - end - - def test_region_backend_buckets_rest - skip unless Google::Cloud::Compute.region_backend_buckets_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_backend_buckets do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionBackendBuckets::Rest::Client, client - end - end - - def test_region_backend_services_rest - skip unless Google::Cloud::Compute.region_backend_services_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_backend_services do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionBackendServices::Rest::Client, client - end - end - - def test_region_commitments_rest - skip unless Google::Cloud::Compute.region_commitments_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_commitments do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionCommitments::Rest::Client, client - end - end - - def test_region_composite_health_checks_rest - skip unless Google::Cloud::Compute.region_composite_health_checks_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_composite_health_checks do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionCompositeHealthChecks::Rest::Client, client - end - end - - def test_region_disk_types_rest - skip unless Google::Cloud::Compute.region_disk_types_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_disk_types do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionDiskTypes::Rest::Client, client - end - end - - def test_region_disks_rest - skip unless Google::Cloud::Compute.region_disks_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_disks do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionDisks::Rest::Client, client - end - end - - def test_region_health_aggregation_policies_rest - skip unless Google::Cloud::Compute.region_health_aggregation_policies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_health_aggregation_policies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionHealthAggregationPolicies::Rest::Client, client - end - end - - def test_region_health_check_services_rest - skip unless Google::Cloud::Compute.region_health_check_services_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_health_check_services do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionHealthCheckServices::Rest::Client, client - end - end - - def test_region_health_checks_rest - skip unless Google::Cloud::Compute.region_health_checks_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_health_checks do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionHealthChecks::Rest::Client, client - end - end - - def test_region_health_sources_rest - skip unless Google::Cloud::Compute.region_health_sources_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_health_sources do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client, client - end - end - - def test_region_instance_group_manager_resize_requests_rest - skip unless Google::Cloud::Compute.region_instance_group_manager_resize_requests_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_instance_group_manager_resize_requests do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionInstanceGroupManagerResizeRequests::Rest::Client, client - end - end - - def test_region_instance_group_managers_rest - skip unless Google::Cloud::Compute.region_instance_group_managers_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_instance_group_managers do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Rest::Client, client - end - end - - def test_region_instance_groups_rest - skip unless Google::Cloud::Compute.region_instance_groups_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_instance_groups do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionInstanceGroups::Rest::Client, client - end - end - - def test_region_instance_templates_rest - skip unless Google::Cloud::Compute.region_instance_templates_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_instance_templates do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionInstanceTemplates::Rest::Client, client - end - end - - def test_region_instances_rest - skip unless Google::Cloud::Compute.region_instances_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_instances do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionInstances::Rest::Client, client - end - end - - def test_region_instant_snapshot_groups_rest - skip unless Google::Cloud::Compute.region_instant_snapshot_groups_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_instant_snapshot_groups do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionInstantSnapshotGroups::Rest::Client, client - end - end - - def test_region_instant_snapshots_rest - skip unless Google::Cloud::Compute.region_instant_snapshots_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_instant_snapshots do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionInstantSnapshots::Rest::Client, client - end - end - - def test_region_network_endpoint_groups_rest - skip unless Google::Cloud::Compute.region_network_endpoint_groups_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_network_endpoint_groups do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionNetworkEndpointGroups::Rest::Client, client - end - end - - def test_region_network_firewall_policies_rest - skip unless Google::Cloud::Compute.region_network_firewall_policies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_network_firewall_policies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionNetworkFirewallPolicies::Rest::Client, client - end - end - - def test_region_notification_endpoints_rest - skip unless Google::Cloud::Compute.region_notification_endpoints_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_notification_endpoints do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionNotificationEndpoints::Rest::Client, client - end - end - - def test_region_operations_rest - skip unless Google::Cloud::Compute.region_operations_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_operations do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionOperations::Rest::Client, client - end - end - - def test_region_security_policies_rest - skip unless Google::Cloud::Compute.region_security_policies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_security_policies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionSecurityPolicies::Rest::Client, client - end - end - - def test_region_snapshot_settings_rest - skip unless Google::Cloud::Compute.region_snapshot_settings_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_snapshot_settings do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::Client, client - end - end - - def test_region_snapshots_rest - skip unless Google::Cloud::Compute.region_snapshots_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_snapshots do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionSnapshots::Rest::Client, client - end - end - - def test_region_ssl_certificates_rest - skip unless Google::Cloud::Compute.region_ssl_certificates_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_ssl_certificates do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionSslCertificates::Rest::Client, client - end - end - - def test_region_ssl_policies_rest - skip unless Google::Cloud::Compute.region_ssl_policies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_ssl_policies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionSslPolicies::Rest::Client, client - end - end - - def test_region_target_http_proxies_rest - skip unless Google::Cloud::Compute.region_target_http_proxies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_target_http_proxies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionTargetHttpProxies::Rest::Client, client - end - end - - def test_region_target_https_proxies_rest - skip unless Google::Cloud::Compute.region_target_https_proxies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_target_https_proxies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionTargetHttpsProxies::Rest::Client, client - end - end - - def test_region_target_tcp_proxies_rest - skip unless Google::Cloud::Compute.region_target_tcp_proxies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_target_tcp_proxies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionTargetTcpProxies::Rest::Client, client - end - end - - def test_region_url_maps_rest - skip unless Google::Cloud::Compute.region_url_maps_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_url_maps do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionUrlMaps::Rest::Client, client - end - end - - def test_region_zones_rest - skip unless Google::Cloud::Compute.region_zones_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.region_zones do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::RegionZones::Rest::Client, client - end - end - - def test_regions_rest - skip unless Google::Cloud::Compute.regions_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.regions do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Regions::Rest::Client, client - end - end - - def test_reservation_blocks_rest - skip unless Google::Cloud::Compute.reservation_blocks_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.reservation_blocks do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client, client - end - end - - def test_reservation_slots_rest - skip unless Google::Cloud::Compute.reservation_slots_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.reservation_slots do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::ReservationSlots::Rest::Client, client - end - end - - def test_reservation_sub_blocks_rest - skip unless Google::Cloud::Compute.reservation_sub_blocks_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.reservation_sub_blocks do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::ReservationSubBlocks::Rest::Client, client - end - end - - def test_reservations_rest - skip unless Google::Cloud::Compute.reservations_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.reservations do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Reservations::Rest::Client, client - end - end - - def test_resource_policies_rest - skip unless Google::Cloud::Compute.resource_policies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.resource_policies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::ResourcePolicies::Rest::Client, client - end - end - - def test_routers_rest - skip unless Google::Cloud::Compute.routers_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.routers do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Routers::Rest::Client, client - end - end - - def test_routes_rest - skip unless Google::Cloud::Compute.routes_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.routes do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Routes::Rest::Client, client - end - end - - def test_security_policies_rest - skip unless Google::Cloud::Compute.security_policies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.security_policies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client, client - end - end - - def test_service_attachments_rest - skip unless Google::Cloud::Compute.service_attachments_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.service_attachments do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::ServiceAttachments::Rest::Client, client - end - end - - def test_snapshot_settings_service_rest - skip unless Google::Cloud::Compute.snapshot_settings_service_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.snapshot_settings_service do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::SnapshotSettingsService::Rest::Client, client - end - end - - def test_snapshots_rest - skip unless Google::Cloud::Compute.snapshots_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.snapshots do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Snapshots::Rest::Client, client - end - end - - def test_ssl_certificates_rest - skip unless Google::Cloud::Compute.ssl_certificates_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.ssl_certificates do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::SslCertificates::Rest::Client, client - end - end - - def test_ssl_policies_rest - skip unless Google::Cloud::Compute.ssl_policies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.ssl_policies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::SslPolicies::Rest::Client, client - end - end - - def test_storage_pool_types_rest - skip unless Google::Cloud::Compute.storage_pool_types_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.storage_pool_types do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::StoragePoolTypes::Rest::Client, client - end - end - - def test_storage_pools_rest - skip unless Google::Cloud::Compute.storage_pools_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.storage_pools do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::StoragePools::Rest::Client, client - end - end - - def test_subnetworks_rest - skip unless Google::Cloud::Compute.subnetworks_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.subnetworks do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Subnetworks::Rest::Client, client - end - end - - def test_target_grpc_proxies_rest - skip unless Google::Cloud::Compute.target_grpc_proxies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.target_grpc_proxies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::TargetGrpcProxies::Rest::Client, client - end - end - - def test_target_http_proxies_rest - skip unless Google::Cloud::Compute.target_http_proxies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.target_http_proxies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::TargetHttpProxies::Rest::Client, client - end - end - - def test_target_https_proxies_rest - skip unless Google::Cloud::Compute.target_https_proxies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.target_https_proxies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::TargetHttpsProxies::Rest::Client, client - end - end - - def test_target_instances_rest - skip unless Google::Cloud::Compute.target_instances_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.target_instances do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::TargetInstances::Rest::Client, client - end - end - - def test_target_pools_rest - skip unless Google::Cloud::Compute.target_pools_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.target_pools do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::TargetPools::Rest::Client, client - end - end - - def test_target_ssl_proxies_rest - skip unless Google::Cloud::Compute.target_ssl_proxies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.target_ssl_proxies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::TargetSslProxies::Rest::Client, client - end - end - - def test_target_tcp_proxies_rest - skip unless Google::Cloud::Compute.target_tcp_proxies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.target_tcp_proxies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::TargetTcpProxies::Rest::Client, client - end - end - - def test_target_vpn_gateways_rest - skip unless Google::Cloud::Compute.target_vpn_gateways_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.target_vpn_gateways do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::TargetVpnGateways::Rest::Client, client - end - end - - def test_url_maps_rest - skip unless Google::Cloud::Compute.url_maps_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.url_maps do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::UrlMaps::Rest::Client, client - end - end - - def test_vpn_gateways_rest - skip unless Google::Cloud::Compute.vpn_gateways_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.vpn_gateways do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::VpnGateways::Rest::Client, client - end - end - - def test_vpn_tunnels_rest - skip unless Google::Cloud::Compute.vpn_tunnels_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.vpn_tunnels do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::VpnTunnels::Rest::Client, client - end - end - - def test_wire_groups_rest - skip unless Google::Cloud::Compute.wire_groups_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.wire_groups do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::WireGroups::Rest::Client, client - end - end - - def test_zone_operations_rest - skip unless Google::Cloud::Compute.zone_operations_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.zone_operations do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::ZoneOperations::Rest::Client, client - end - end - - def test_zone_vm_extension_policies_rest - skip unless Google::Cloud::Compute.zone_vm_extension_policies_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.zone_vm_extension_policies do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::ZoneVmExtensionPolicies::Rest::Client, client - end - end - - def test_zones_rest - skip unless Google::Cloud::Compute.zones_available? - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Compute.zones do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Compute::V1::Zones::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-compute/test/google/cloud/compute/version_test.rb b/owl-bot-staging/google-cloud-compute/test/google/cloud/compute/version_test.rb deleted file mode 100644 index 9af84994fa5a..000000000000 --- a/owl-bot-staging/google-cloud-compute/test/google/cloud/compute/version_test.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "google/cloud/compute/version" - -class Google::Cloud::Compute::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::Compute::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-compute/test/helper.rb b/owl-bot-staging/google-cloud-compute/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-compute/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct"