From f09724143686c18100cb43d06ad4cbc88db40a86 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 24 Feb 2026 22:03:25 +0000 Subject: [PATCH 1/2] feat: Add transcription fields to Session Service feat: Add v1 API version for Session Service docs: A comment for field `expire_time` in message `.google.cloud.aiplatform.v1beta1.Session` is changed docs: A comment for field `ttl` in message `.google.cloud.aiplatform.v1beta1.Session` is changed docs: A comment for field `filter` in message `.google.cloud.aiplatform.v1beta1.ListSessionsRequest` is changed PiperOrigin-RevId: 874707222 Source-Link: https://github.com/googleapis/googleapis/commit/1499898e0aed31b9aee1a41f5997bc787f1bf4b4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/95784c67e7ef84d5239277624d934325608122b9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWFpX3BsYXRmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiI5NTc4NGM2N2U3ZWY4NGQ1MjM5Mjc3NjI0ZDkzNDMyNTYwODEyMmI5In0= --- .../google-cloud-ai_platform/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-ai_platform/.rubocop.yml | 39 + .../google-cloud-ai_platform/.toys.rb | 28 + .../google-cloud-ai_platform/.yardopts | 11 + .../AUTHENTICATION.md | 122 + .../google-cloud-ai_platform/CHANGELOG.md | 2 + .../google-cloud-ai_platform/Gemfile | 28 + .../google-cloud-ai_platform/LICENSE.md | 201 ++ .../google-cloud-ai_platform/README.md | 142 + .../google-cloud-ai_platform/Rakefile | 169 ++ .../google-cloud-ai_platform.gemspec | 27 + .../lib/google-cloud-ai_platform.rb | 19 + .../lib/google/cloud/ai_platform.rb | 2482 +++++++++++++++++ .../lib/google/cloud/ai_platform/version.rb | 26 + .../google/cloud/ai_platform/client_test.rb | 757 +++++ .../google/cloud/ai_platform/version_test.rb | 26 + .../google-cloud-ai_platform/test/helper.rb | 25 + 18 files changed, 4144 insertions(+) create mode 100644 owl-bot-staging/google-cloud-ai_platform/.gitignore create mode 100644 owl-bot-staging/google-cloud-ai_platform/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-ai_platform/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-ai_platform/.toys.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform/.yardopts create mode 100644 owl-bot-staging/google-cloud-ai_platform/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-ai_platform/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-ai_platform/Gemfile create mode 100644 owl-bot-staging/google-cloud-ai_platform/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-ai_platform/README.md create mode 100644 owl-bot-staging/google-cloud-ai_platform/Rakefile create mode 100644 owl-bot-staging/google-cloud-ai_platform/google-cloud-ai_platform.gemspec create mode 100644 owl-bot-staging/google-cloud-ai_platform/lib/google-cloud-ai_platform.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform/version.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/client_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/version_test.rb create mode 100644 owl-bot-staging/google-cloud-ai_platform/test/helper.rb diff --git a/owl-bot-staging/google-cloud-ai_platform/.gitignore b/owl-bot-staging/google-cloud-ai_platform/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/.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-ai_platform/.repo-metadata.json b/owl-bot-staging/google-cloud-ai_platform/.repo-metadata.json new file mode 100644 index 000000000000..1b552aa73b63 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "aiplatform.googleapis.com", + "api_shortname": "aiplatform", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform/latest", + "distribution_name": "google-cloud-ai_platform", + "is_cloud": true, + "language": "ruby", + "name": "aiplatform", + "name_pretty": "Vertex AI API", + "product_documentation": "https://cloud.google.com/vertex-ai/docs/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Vertex AI enables data scientists, developers, and AI newcomers to create custom machine learning models specific to their business needs by leveraging Google's state-of-the-art transfer learning and innovative AI research.", + "ruby-cloud-product-url": "https://cloud.google.com/vertex-ai/docs/", + "ruby-cloud-service-override": "AiPlatform=AIPlatform", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-ai_platform/.rubocop.yml b/owl-bot-staging/google-cloud-ai_platform/.rubocop.yml new file mode 100644 index 000000000000..35c381fe360b --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-ai_platform.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-ai_platform.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-ai_platform/.toys.rb b/owl-bot-staging/google-cloud-ai_platform/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/.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-ai_platform/.yardopts b/owl-bot-staging/google-cloud-ai_platform/.yardopts new file mode 100644 index 000000000000..ef9205e4a698 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Vertex AI 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-ai_platform/AUTHENTICATION.md b/owl-bot-staging/google-cloud-ai_platform/AUTHENTICATION.md new file mode 100644 index 000000000000..368825a3e31d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-ai_platform 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-ai_platform 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/ai_platform" + +client = Google::Cloud::AIPlatform.data_foundry_service do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/ai_platform" + +Google::Cloud::AIPlatform.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::AIPlatform.data_foundry_service +``` + +### 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-ai_platform +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/ai_platform" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::AIPlatform.data_foundry_service +``` + +### 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-ai_platform/CHANGELOG.md b/owl-bot-staging/google-cloud-ai_platform/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-ai_platform/Gemfile b/owl-bot-staging/google-cloud-ai_platform/Gemfile new file mode 100644 index 000000000000..7483ca19e0be --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-ai_platform-v1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-ai_platform.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.30.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-ai_platform/LICENSE.md b/owl-bot-staging/google-cloud-ai_platform/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/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-ai_platform/README.md b/owl-bot-staging/google-cloud-ai_platform/README.md new file mode 100644 index 000000000000..339cdd9cf558 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Vertex AI API + +API Client library for the Vertex AI API + +Vertex AI enables data scientists, developers, and AI newcomers to create custom machine learning models specific to their business needs by leveraging Google's state-of-the-art transfer learning and innovative AI research. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-ai_platform-v*`. +The gem `google-cloud-ai_platform` 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-ai_platform/latest) +for this library, google-cloud-ai_platform, 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-ai_platform-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/vertex-ai/docs/) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-ai_platform +``` + +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/aiplatform.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/ai_platform" + +client = Google::Cloud::AIPlatform.data_foundry_service +request = ::Google::Cloud::AIPlatform::V1::GenerateSyntheticDataRequest.new # (request fields as keyword arguments...) +response = client.generate_synthetic_data 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-ai_platform-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-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-ai_platform`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-ai_platform-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-ai_platform`. +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-ai_platform-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-ai_platform/Rakefile b/owl-bot-staging/google-cloud-ai_platform/Rakefile new file mode 100644 index 000000000000..6bc1601321de --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/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-ai_platform acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/ai_platform/v1/data_foundry_service/credentials" + ::Google::Cloud::AIPlatform::V1::DataFoundryService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_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-ai_platform 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-ai_platform 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-ai_platform 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-ai_platform gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-ai_platform" + header "google-cloud-ai_platform rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-ai_platform yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-ai_platform 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-ai_platform 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-ai_platform 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-ai_platform/google-cloud-ai_platform.gemspec b/owl-bot-staging/google-cloud-ai_platform/google-cloud-ai_platform.gemspec new file mode 100644 index 000000000000..d2959b95283d --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/google-cloud-ai_platform.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/ai_platform/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-ai_platform" + gem.version = Google::Cloud::AIPlatform::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Vertex AI enables data scientists, developers, and AI newcomers to create custom machine learning models specific to their business needs by leveraging Google's state-of-the-art transfer learning and innovative AI research." + gem.summary = "API Client library for the Vertex AI 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.0" + + gem.add_dependency "google-cloud-ai_platform-v1", "~> 1.0" + gem.add_dependency "google-cloud-core", "~> 1.6" +end diff --git a/owl-bot-staging/google-cloud-ai_platform/lib/google-cloud-ai_platform.rb b/owl-bot-staging/google-cloud-ai_platform/lib/google-cloud-ai_platform.rb new file mode 100644 index 000000000000..55c3776b2dba --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/lib/google-cloud-ai_platform.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/ai_platform" unless defined? Google::Cloud::AIPlatform::VERSION diff --git a/owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform.rb b/owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform.rb new file mode 100644 index 000000000000..ff1a326d6a44 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform.rb @@ -0,0 +1,2482 @@ +# 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/ai_platform/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! :ai_platform 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! :interceptors, nil, match: ::Array + 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 AIPlatform + ## + # Create a new client object for DataFoundryService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::DataFoundryService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-DataFoundryService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the DataFoundryService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the DataFoundryService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.data_foundry_service_available?}. + # + # ## About DataFoundryService + # + # Service for generating and preparing datasets for Gen AI evaluation. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.data_foundry_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:DataFoundryService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the DataFoundryService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.data_foundry_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 DataFoundryService service, + # or if the versioned client gem needs an update to support the DataFoundryService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.data_foundry_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :DataFoundryService + service_module = service_module.const_get :DataFoundryService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for DatasetService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::DatasetService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-DatasetService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the DatasetService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the DatasetService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.dataset_service_available?}. + # + # ## About DatasetService + # + # The service that manages Vertex AI Dataset and its child resources. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.dataset_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:DatasetService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the DatasetService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.dataset_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 DatasetService service, + # or if the versioned client gem needs an update to support the DatasetService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.dataset_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :DatasetService + service_module = service_module.const_get :DatasetService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for DeploymentResourcePoolService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-DeploymentResourcePoolService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the DeploymentResourcePoolService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the DeploymentResourcePoolService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.deployment_resource_pool_service_available?}. + # + # ## About DeploymentResourcePoolService + # + # A service that manages the DeploymentResourcePool resource. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.deployment_resource_pool_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:DeploymentResourcePoolService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the DeploymentResourcePoolService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.deployment_resource_pool_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 DeploymentResourcePoolService service, + # or if the versioned client gem needs an update to support the DeploymentResourcePoolService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.deployment_resource_pool_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :DeploymentResourcePoolService + service_module = service_module.const_get :DeploymentResourcePoolService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for EndpointService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::EndpointService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-EndpointService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the EndpointService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the EndpointService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.endpoint_service_available?}. + # + # ## About EndpointService + # + # A service for managing Vertex AI's Endpoints. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.endpoint_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:EndpointService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the EndpointService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.endpoint_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 EndpointService service, + # or if the versioned client gem needs an update to support the EndpointService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.endpoint_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :EndpointService + service_module = service_module.const_get :EndpointService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for EvaluationService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::EvaluationService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-EvaluationService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the EvaluationService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the EvaluationService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.evaluation_service_available?}. + # + # ## About EvaluationService + # + # Vertex AI Online Evaluation Service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.evaluation_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:EvaluationService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the EvaluationService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.evaluation_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 EvaluationService service, + # or if the versioned client gem needs an update to support the EvaluationService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.evaluation_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :EvaluationService + service_module = service_module.const_get :EvaluationService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for FeatureOnlineStoreAdminService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-FeatureOnlineStoreAdminService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the FeatureOnlineStoreAdminService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the FeatureOnlineStoreAdminService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.feature_online_store_admin_service_available?}. + # + # ## About FeatureOnlineStoreAdminService + # + # The service that handles CRUD and List for resources for + # FeatureOnlineStore. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.feature_online_store_admin_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:FeatureOnlineStoreAdminService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the FeatureOnlineStoreAdminService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.feature_online_store_admin_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 FeatureOnlineStoreAdminService service, + # or if the versioned client gem needs an update to support the FeatureOnlineStoreAdminService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.feature_online_store_admin_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :FeatureOnlineStoreAdminService + service_module = service_module.const_get :FeatureOnlineStoreAdminService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for FeaturestoreOnlineServingService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-FeaturestoreOnlineServingService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the FeaturestoreOnlineServingService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the FeaturestoreOnlineServingService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.featurestore_online_serving_service_available?}. + # + # ## About FeaturestoreOnlineServingService + # + # A service for serving online feature values. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.featurestore_online_serving_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:FeaturestoreOnlineServingService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the FeaturestoreOnlineServingService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.featurestore_online_serving_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 FeaturestoreOnlineServingService service, + # or if the versioned client gem needs an update to support the FeaturestoreOnlineServingService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.featurestore_online_serving_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :FeaturestoreOnlineServingService + service_module = service_module.const_get :FeaturestoreOnlineServingService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for FeatureOnlineStoreService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-FeatureOnlineStoreService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the FeatureOnlineStoreService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the FeatureOnlineStoreService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.feature_online_store_service_available?}. + # + # ## About FeatureOnlineStoreService + # + # A service for fetching feature values from the online store. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.feature_online_store_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:FeatureOnlineStoreService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the FeatureOnlineStoreService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.feature_online_store_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 FeatureOnlineStoreService service, + # or if the versioned client gem needs an update to support the FeatureOnlineStoreService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.feature_online_store_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :FeatureOnlineStoreService + service_module = service_module.const_get :FeatureOnlineStoreService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for FeaturestoreService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::FeaturestoreService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-FeaturestoreService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the FeaturestoreService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the FeaturestoreService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.featurestore_service_available?}. + # + # ## About FeaturestoreService + # + # The service that handles CRUD and List for resources for Featurestore. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.featurestore_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:FeaturestoreService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the FeaturestoreService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.featurestore_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 FeaturestoreService service, + # or if the versioned client gem needs an update to support the FeaturestoreService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.featurestore_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :FeaturestoreService + service_module = service_module.const_get :FeaturestoreService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for FeatureRegistryService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-FeatureRegistryService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the FeatureRegistryService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the FeatureRegistryService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.feature_registry_service_available?}. + # + # ## About FeatureRegistryService + # + # The service that handles CRUD and List for resources for + # FeatureRegistry. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.feature_registry_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:FeatureRegistryService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the FeatureRegistryService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.feature_registry_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 FeatureRegistryService service, + # or if the versioned client gem needs an update to support the FeatureRegistryService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.feature_registry_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :FeatureRegistryService + service_module = service_module.const_get :FeatureRegistryService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for GenAiCacheService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::GenAiCacheService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenAiCacheService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the GenAiCacheService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the GenAiCacheService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.gen_ai_cache_service_available?}. + # + # ## About GenAiCacheService + # + # Service for managing Vertex AI's CachedContent resource. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.gen_ai_cache_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:GenAiCacheService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the GenAiCacheService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.gen_ai_cache_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 GenAiCacheService service, + # or if the versioned client gem needs an update to support the GenAiCacheService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.gen_ai_cache_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :GenAiCacheService + service_module = service_module.const_get :GenAiCacheService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for GenAiTuningService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::GenAiTuningService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenAiTuningService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the GenAiTuningService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the GenAiTuningService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.gen_ai_tuning_service_available?}. + # + # ## About GenAiTuningService + # + # A service for creating and managing GenAI Tuning Jobs. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.gen_ai_tuning_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:GenAiTuningService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the GenAiTuningService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.gen_ai_tuning_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 GenAiTuningService service, + # or if the versioned client gem needs an update to support the GenAiTuningService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.gen_ai_tuning_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :GenAiTuningService + service_module = service_module.const_get :GenAiTuningService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for IndexEndpointService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::IndexEndpointService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-IndexEndpointService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the IndexEndpointService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the IndexEndpointService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.index_endpoint_service_available?}. + # + # ## About IndexEndpointService + # + # A service for managing Vertex AI's IndexEndpoints. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.index_endpoint_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:IndexEndpointService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the IndexEndpointService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.index_endpoint_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 IndexEndpointService service, + # or if the versioned client gem needs an update to support the IndexEndpointService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.index_endpoint_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :IndexEndpointService + service_module = service_module.const_get :IndexEndpointService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for IndexService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::IndexService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-IndexService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the IndexService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the IndexService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.index_service_available?}. + # + # ## About IndexService + # + # A service for creating and managing Vertex AI's Index resources. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.index_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:IndexService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the IndexService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.index_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 IndexService service, + # or if the versioned client gem needs an update to support the IndexService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.index_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :IndexService + service_module = service_module.const_get :IndexService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for JobService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::JobService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-JobService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the JobService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the JobService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.job_service_available?}. + # + # ## About JobService + # + # A service for creating and managing Vertex AI's jobs. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.job_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:JobService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the JobService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.job_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 JobService service, + # or if the versioned client gem needs an update to support the JobService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.job_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :JobService + service_module = service_module.const_get :JobService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for PredictionService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::PredictionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-PredictionService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the PredictionService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the PredictionService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.prediction_service_available?}. + # + # ## About PredictionService + # + # A service for online predictions and explanations. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.prediction_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:PredictionService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the PredictionService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.prediction_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 PredictionService service, + # or if the versioned client gem needs an update to support the PredictionService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.prediction_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :PredictionService + service_module = service_module.const_get :PredictionService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for LlmUtilityService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::LlmUtilityService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-LlmUtilityService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the LlmUtilityService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the LlmUtilityService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.llm_utility_service_available?}. + # + # ## About LlmUtilityService + # + # Service for LLM related utility functions. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.llm_utility_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:LlmUtilityService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the LlmUtilityService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.llm_utility_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 LlmUtilityService service, + # or if the versioned client gem needs an update to support the LlmUtilityService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.llm_utility_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :LlmUtilityService + service_module = service_module.const_get :LlmUtilityService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for MatchService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::MatchService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-MatchService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the MatchService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the MatchService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.match_service_available?}. + # + # ## About MatchService + # + # MatchService is a Google managed service for efficient vector similarity + # search at scale. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.match_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:MatchService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the MatchService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.match_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 MatchService service, + # or if the versioned client gem needs an update to support the MatchService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.match_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :MatchService + service_module = service_module.const_get :MatchService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for MetadataService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::MetadataService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-MetadataService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the MetadataService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the MetadataService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.metadata_service_available?}. + # + # ## About MetadataService + # + # Service for reading and writing metadata entries. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.metadata_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:MetadataService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the MetadataService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.metadata_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 MetadataService service, + # or if the versioned client gem needs an update to support the MetadataService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.metadata_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :MetadataService + service_module = service_module.const_get :MetadataService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for MigrationService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::MigrationService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-MigrationService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the MigrationService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the MigrationService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.migration_service_available?}. + # + # ## About MigrationService + # + # A service that migrates resources from automl.googleapis.com, + # datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.migration_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:MigrationService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the MigrationService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.migration_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 MigrationService service, + # or if the versioned client gem needs an update to support the MigrationService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.migration_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :MigrationService + service_module = service_module.const_get :MigrationService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ModelGardenService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::ModelGardenService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-ModelGardenService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ModelGardenService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the ModelGardenService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.model_garden_service_available?}. + # + # ## About ModelGardenService + # + # The interface of Model Garden Service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.model_garden_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:ModelGardenService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the ModelGardenService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.model_garden_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 ModelGardenService service, + # or if the versioned client gem needs an update to support the ModelGardenService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.model_garden_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :ModelGardenService + service_module = service_module.const_get :ModelGardenService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ModelService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::ModelService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-ModelService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ModelService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the ModelService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.model_service_available?}. + # + # ## About ModelService + # + # A service for managing Vertex AI's machine learning Models. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.model_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:ModelService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the ModelService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.model_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 ModelService service, + # or if the versioned client gem needs an update to support the ModelService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.model_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :ModelService + service_module = service_module.const_get :ModelService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for NotebookService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::NotebookService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-NotebookService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the NotebookService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the NotebookService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.notebook_service_available?}. + # + # ## About NotebookService + # + # The interface for Vertex Notebook service (a.k.a. Colab on Workbench). + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.notebook_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:NotebookService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the NotebookService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.notebook_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 NotebookService service, + # or if the versioned client gem needs an update to support the NotebookService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.notebook_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :NotebookService + service_module = service_module.const_get :NotebookService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for PersistentResourceService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::PersistentResourceService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-PersistentResourceService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the PersistentResourceService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the PersistentResourceService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.persistent_resource_service_available?}. + # + # ## About PersistentResourceService + # + # A service for managing Vertex AI's machine learning PersistentResource. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.persistent_resource_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:PersistentResourceService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the PersistentResourceService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.persistent_resource_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 PersistentResourceService service, + # or if the versioned client gem needs an update to support the PersistentResourceService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.persistent_resource_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :PersistentResourceService + service_module = service_module.const_get :PersistentResourceService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for PipelineService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::PipelineService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-PipelineService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the PipelineService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the PipelineService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.pipeline_service_available?}. + # + # ## About PipelineService + # + # A service for creating and managing Vertex AI's pipelines. This includes both + # `TrainingPipeline` resources (used for AutoML and custom training) and + # `PipelineJob` resources (used for Vertex AI Pipelines). + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.pipeline_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:PipelineService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the PipelineService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.pipeline_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 PipelineService service, + # or if the versioned client gem needs an update to support the PipelineService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.pipeline_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :PipelineService + service_module = service_module.const_get :PipelineService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ReasoningEngineExecutionService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-ReasoningEngineExecutionService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ReasoningEngineExecutionService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the ReasoningEngineExecutionService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.reasoning_engine_execution_service_available?}. + # + # ## About ReasoningEngineExecutionService + # + # A service for executing queries on Reasoning Engine. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.reasoning_engine_execution_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:ReasoningEngineExecutionService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the ReasoningEngineExecutionService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.reasoning_engine_execution_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 ReasoningEngineExecutionService service, + # or if the versioned client gem needs an update to support the ReasoningEngineExecutionService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.reasoning_engine_execution_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :ReasoningEngineExecutionService + service_module = service_module.const_get :ReasoningEngineExecutionService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ReasoningEngineService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-ReasoningEngineService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ReasoningEngineService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the ReasoningEngineService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.reasoning_engine_service_available?}. + # + # ## About ReasoningEngineService + # + # A service for managing Vertex AI's Reasoning Engines. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.reasoning_engine_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:ReasoningEngineService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the ReasoningEngineService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.reasoning_engine_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 ReasoningEngineService service, + # or if the versioned client gem needs an update to support the ReasoningEngineService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.reasoning_engine_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :ReasoningEngineService + service_module = service_module.const_get :ReasoningEngineService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ScheduleService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::ScheduleService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-ScheduleService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ScheduleService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the ScheduleService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.schedule_service_available?}. + # + # ## About ScheduleService + # + # A service for creating and managing Vertex AI's Schedule resources to + # periodically launch shceudled runs to make API calls. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.schedule_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:ScheduleService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the ScheduleService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.schedule_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 ScheduleService service, + # or if the versioned client gem needs an update to support the ScheduleService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.schedule_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :ScheduleService + service_module = service_module.const_get :ScheduleService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for SessionService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::SessionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-SessionService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the SessionService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the SessionService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.session_service_available?}. + # + # ## About SessionService + # + # The service that manages Vertex Session related resources. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.session_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:SessionService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the SessionService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.session_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 SessionService service, + # or if the versioned client gem needs an update to support the SessionService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.session_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :SessionService + service_module = service_module.const_get :SessionService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for SpecialistPoolService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-SpecialistPoolService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the SpecialistPoolService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the SpecialistPoolService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.specialist_pool_service_available?}. + # + # ## About SpecialistPoolService + # + # A service for creating and managing Customer SpecialistPools. + # When customers start Data Labeling jobs, they can reuse/create Specialist + # Pools to bring their own Specialists to label the data. + # Customers can add/remove Managers for the Specialist Pool on Cloud console, + # then Managers will get email notifications to manage Specialists and tasks on + # CrowdCompute console. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.specialist_pool_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:SpecialistPoolService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the SpecialistPoolService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.specialist_pool_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 SpecialistPoolService service, + # or if the versioned client gem needs an update to support the SpecialistPoolService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.specialist_pool_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :SpecialistPoolService + service_module = service_module.const_get :SpecialistPoolService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for TensorboardService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::TensorboardService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-TensorboardService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TensorboardService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the TensorboardService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.tensorboard_service_available?}. + # + # ## About TensorboardService + # + # TensorboardService + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.tensorboard_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:TensorboardService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the TensorboardService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.tensorboard_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 TensorboardService service, + # or if the versioned client gem needs an update to support the TensorboardService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.tensorboard_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :TensorboardService + service_module = service_module.const_get :TensorboardService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for VertexRagDataService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::VertexRagDataService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-VertexRagDataService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the VertexRagDataService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the VertexRagDataService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.vertex_rag_data_service_available?}. + # + # ## About VertexRagDataService + # + # A service for managing user data for RAG. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.vertex_rag_data_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:VertexRagDataService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the VertexRagDataService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.vertex_rag_data_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 VertexRagDataService service, + # or if the versioned client gem needs an update to support the VertexRagDataService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.vertex_rag_data_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :VertexRagDataService + service_module = service_module.const_get :VertexRagDataService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for VertexRagService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::VertexRagService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-VertexRagService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the VertexRagService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the VertexRagService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.vertex_rag_service_available?}. + # + # ## About VertexRagService + # + # A service for retrieving relevant contexts. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.vertex_rag_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:VertexRagService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the VertexRagService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.vertex_rag_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 VertexRagService service, + # or if the versioned client gem needs an update to support the VertexRagService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.vertex_rag_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :VertexRagService + service_module = service_module.const_get :VertexRagService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for VizierService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::VizierService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-VizierService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the VizierService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the VizierService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.vizier_service_available?}. + # + # ## About VizierService + # + # Vertex AI Vizier API. + # + # Vertex AI Vizier is a service to solve blackbox optimization problems, + # such as tuning machine learning hyperparameters and searching over deep + # learning architectures. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.vizier_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:VizierService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the VizierService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.vizier_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 VizierService service, + # or if the versioned client gem needs an update to support the VizierService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.vizier_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :VizierService + service_module = service_module.const_get :VizierService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-ai_platform 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. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `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.ai_platform if block_given? + + ::Google::Cloud.configure.ai_platform + end + end + end +end + +helper_path = ::File.join __dir__, "ai_platform", "helpers.rb" +require "google/cloud/ai_platform/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform/version.rb b/owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform/version.rb new file mode 100644 index 000000000000..1e6c51cb3574 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform/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 AIPlatform + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/client_test.rb b/owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/client_test.rb new file mode 100644 index 000000000000..719f9ef60c57 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/client_test.rb @@ -0,0 +1,757 @@ +# 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/ai_platform" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::AIPlatform::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_data_foundry_service_grpc + skip unless Google::Cloud::AIPlatform.data_foundry_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.data_foundry_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::DataFoundryService::Client, client + end + end + + def test_data_foundry_service_rest + skip unless Google::Cloud::AIPlatform.data_foundry_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.data_foundry_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::DataFoundryService::Rest::Client, client + end + end + + def test_dataset_service_grpc + skip unless Google::Cloud::AIPlatform.dataset_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.dataset_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::DatasetService::Client, client + end + end + + def test_dataset_service_rest + skip unless Google::Cloud::AIPlatform.dataset_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.dataset_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::DatasetService::Rest::Client, client + end + end + + def test_deployment_resource_pool_service_grpc + skip unless Google::Cloud::AIPlatform.deployment_resource_pool_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.deployment_resource_pool_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client, client + end + end + + def test_deployment_resource_pool_service_rest + skip unless Google::Cloud::AIPlatform.deployment_resource_pool_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.deployment_resource_pool_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Rest::Client, client + end + end + + def test_endpoint_service_grpc + skip unless Google::Cloud::AIPlatform.endpoint_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.endpoint_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::EndpointService::Client, client + end + end + + def test_endpoint_service_rest + skip unless Google::Cloud::AIPlatform.endpoint_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.endpoint_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::EndpointService::Rest::Client, client + end + end + + def test_evaluation_service_grpc + skip unless Google::Cloud::AIPlatform.evaluation_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.evaluation_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::EvaluationService::Client, client + end + end + + def test_evaluation_service_rest + skip unless Google::Cloud::AIPlatform.evaluation_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.evaluation_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::EvaluationService::Rest::Client, client + end + end + + def test_feature_online_store_admin_service_grpc + skip unless Google::Cloud::AIPlatform.feature_online_store_admin_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.feature_online_store_admin_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client, client + end + end + + def test_feature_online_store_admin_service_rest + skip unless Google::Cloud::AIPlatform.feature_online_store_admin_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.feature_online_store_admin_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::Client, client + end + end + + def test_featurestore_online_serving_service_grpc + skip unless Google::Cloud::AIPlatform.featurestore_online_serving_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.featurestore_online_serving_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client, client + end + end + + def test_featurestore_online_serving_service_rest + skip unless Google::Cloud::AIPlatform.featurestore_online_serving_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.featurestore_online_serving_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Rest::Client, client + end + end + + def test_feature_online_store_service_grpc + skip unless Google::Cloud::AIPlatform.feature_online_store_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.feature_online_store_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client, client + end + end + + def test_feature_online_store_service_rest + skip unless Google::Cloud::AIPlatform.feature_online_store_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.feature_online_store_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Rest::Client, client + end + end + + def test_featurestore_service_grpc + skip unless Google::Cloud::AIPlatform.featurestore_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.featurestore_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::FeaturestoreService::Client, client + end + end + + def test_featurestore_service_rest + skip unless Google::Cloud::AIPlatform.featurestore_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.featurestore_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client, client + end + end + + def test_feature_registry_service_grpc + skip unless Google::Cloud::AIPlatform.feature_registry_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.feature_registry_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client, client + end + end + + def test_feature_registry_service_rest + skip unless Google::Cloud::AIPlatform.feature_registry_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.feature_registry_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::Client, client + end + end + + def test_gen_ai_cache_service_grpc + skip unless Google::Cloud::AIPlatform.gen_ai_cache_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.gen_ai_cache_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::GenAiCacheService::Client, client + end + end + + def test_gen_ai_cache_service_rest + skip unless Google::Cloud::AIPlatform.gen_ai_cache_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.gen_ai_cache_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::GenAiCacheService::Rest::Client, client + end + end + + def test_gen_ai_tuning_service_grpc + skip unless Google::Cloud::AIPlatform.gen_ai_tuning_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.gen_ai_tuning_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::GenAiTuningService::Client, client + end + end + + def test_gen_ai_tuning_service_rest + skip unless Google::Cloud::AIPlatform.gen_ai_tuning_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.gen_ai_tuning_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::GenAiTuningService::Rest::Client, client + end + end + + def test_index_endpoint_service_grpc + skip unless Google::Cloud::AIPlatform.index_endpoint_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.index_endpoint_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::IndexEndpointService::Client, client + end + end + + def test_index_endpoint_service_rest + skip unless Google::Cloud::AIPlatform.index_endpoint_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.index_endpoint_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::IndexEndpointService::Rest::Client, client + end + end + + def test_index_service_grpc + skip unless Google::Cloud::AIPlatform.index_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.index_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::IndexService::Client, client + end + end + + def test_index_service_rest + skip unless Google::Cloud::AIPlatform.index_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.index_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::IndexService::Rest::Client, client + end + end + + def test_job_service_grpc + skip unless Google::Cloud::AIPlatform.job_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.job_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::JobService::Client, client + end + end + + def test_job_service_rest + skip unless Google::Cloud::AIPlatform.job_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.job_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::JobService::Rest::Client, client + end + end + + def test_prediction_service_grpc + skip unless Google::Cloud::AIPlatform.prediction_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.prediction_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::PredictionService::Client, client + end + end + + def test_prediction_service_rest + skip unless Google::Cloud::AIPlatform.prediction_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.prediction_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::PredictionService::Rest::Client, client + end + end + + def test_llm_utility_service_grpc + skip unless Google::Cloud::AIPlatform.llm_utility_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.llm_utility_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::LlmUtilityService::Client, client + end + end + + def test_llm_utility_service_rest + skip unless Google::Cloud::AIPlatform.llm_utility_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.llm_utility_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::LlmUtilityService::Rest::Client, client + end + end + + def test_match_service_grpc + skip unless Google::Cloud::AIPlatform.match_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.match_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::MatchService::Client, client + end + end + + def test_match_service_rest + skip unless Google::Cloud::AIPlatform.match_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.match_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::MatchService::Rest::Client, client + end + end + + def test_metadata_service_grpc + skip unless Google::Cloud::AIPlatform.metadata_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.metadata_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::MetadataService::Client, client + end + end + + def test_metadata_service_rest + skip unless Google::Cloud::AIPlatform.metadata_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.metadata_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::MetadataService::Rest::Client, client + end + end + + def test_migration_service_grpc + skip unless Google::Cloud::AIPlatform.migration_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.migration_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::MigrationService::Client, client + end + end + + def test_migration_service_rest + skip unless Google::Cloud::AIPlatform.migration_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.migration_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client, client + end + end + + def test_model_garden_service_grpc + skip unless Google::Cloud::AIPlatform.model_garden_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.model_garden_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::ModelGardenService::Client, client + end + end + + def test_model_garden_service_rest + skip unless Google::Cloud::AIPlatform.model_garden_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.model_garden_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::ModelGardenService::Rest::Client, client + end + end + + def test_model_service_grpc + skip unless Google::Cloud::AIPlatform.model_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.model_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::ModelService::Client, client + end + end + + def test_model_service_rest + skip unless Google::Cloud::AIPlatform.model_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.model_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::ModelService::Rest::Client, client + end + end + + def test_notebook_service_grpc + skip unless Google::Cloud::AIPlatform.notebook_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.notebook_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::NotebookService::Client, client + end + end + + def test_notebook_service_rest + skip unless Google::Cloud::AIPlatform.notebook_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.notebook_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::NotebookService::Rest::Client, client + end + end + + def test_persistent_resource_service_grpc + skip unless Google::Cloud::AIPlatform.persistent_resource_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.persistent_resource_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::PersistentResourceService::Client, client + end + end + + def test_persistent_resource_service_rest + skip unless Google::Cloud::AIPlatform.persistent_resource_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.persistent_resource_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client, client + end + end + + def test_pipeline_service_grpc + skip unless Google::Cloud::AIPlatform.pipeline_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.pipeline_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::PipelineService::Client, client + end + end + + def test_pipeline_service_rest + skip unless Google::Cloud::AIPlatform.pipeline_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.pipeline_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::PipelineService::Rest::Client, client + end + end + + def test_reasoning_engine_execution_service_grpc + skip unless Google::Cloud::AIPlatform.reasoning_engine_execution_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.reasoning_engine_execution_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client, client + end + end + + def test_reasoning_engine_execution_service_rest + skip unless Google::Cloud::AIPlatform.reasoning_engine_execution_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.reasoning_engine_execution_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client, client + end + end + + def test_reasoning_engine_service_grpc + skip unless Google::Cloud::AIPlatform.reasoning_engine_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.reasoning_engine_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client, client + end + end + + def test_reasoning_engine_service_rest + skip unless Google::Cloud::AIPlatform.reasoning_engine_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.reasoning_engine_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client, client + end + end + + def test_schedule_service_grpc + skip unless Google::Cloud::AIPlatform.schedule_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.schedule_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::ScheduleService::Client, client + end + end + + def test_schedule_service_rest + skip unless Google::Cloud::AIPlatform.schedule_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.schedule_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::ScheduleService::Rest::Client, client + end + end + + def test_session_service_grpc + skip unless Google::Cloud::AIPlatform.session_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.session_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::SessionService::Client, client + end + end + + def test_session_service_rest + skip unless Google::Cloud::AIPlatform.session_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.session_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::SessionService::Rest::Client, client + end + end + + def test_specialist_pool_service_grpc + skip unless Google::Cloud::AIPlatform.specialist_pool_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.specialist_pool_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client, client + end + end + + def test_specialist_pool_service_rest + skip unless Google::Cloud::AIPlatform.specialist_pool_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.specialist_pool_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::SpecialistPoolService::Rest::Client, client + end + end + + def test_tensorboard_service_grpc + skip unless Google::Cloud::AIPlatform.tensorboard_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.tensorboard_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::TensorboardService::Client, client + end + end + + def test_tensorboard_service_rest + skip unless Google::Cloud::AIPlatform.tensorboard_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.tensorboard_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client, client + end + end + + def test_vertex_rag_data_service_grpc + skip unless Google::Cloud::AIPlatform.vertex_rag_data_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.vertex_rag_data_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::VertexRagDataService::Client, client + end + end + + def test_vertex_rag_data_service_rest + skip unless Google::Cloud::AIPlatform.vertex_rag_data_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.vertex_rag_data_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client, client + end + end + + def test_vertex_rag_service_grpc + skip unless Google::Cloud::AIPlatform.vertex_rag_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.vertex_rag_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::VertexRagService::Client, client + end + end + + def test_vertex_rag_service_rest + skip unless Google::Cloud::AIPlatform.vertex_rag_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.vertex_rag_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::VertexRagService::Rest::Client, client + end + end + + def test_vizier_service_grpc + skip unless Google::Cloud::AIPlatform.vizier_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.vizier_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::VizierService::Client, client + end + end + + def test_vizier_service_rest + skip unless Google::Cloud::AIPlatform.vizier_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.vizier_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::VizierService::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/version_test.rb b/owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/version_test.rb new file mode 100644 index 000000000000..9acdfb96a3c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/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/ai_platform/version" + +class Google::Cloud::AIPlatform::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::AIPlatform::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-ai_platform/test/helper.rb b/owl-bot-staging/google-cloud-ai_platform/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ai_platform/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From 4d9758ae4b224d602e1268356b4c8db38f028b9d Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 24 Feb 2026 22:06:38 +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/ai_platform.rb | 70 + .../google/cloud/ai_platform/client_test.rb | 21 + .../google-cloud-ai_platform/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-ai_platform/.rubocop.yml | 39 - .../google-cloud-ai_platform/.toys.rb | 28 - .../google-cloud-ai_platform/.yardopts | 11 - .../AUTHENTICATION.md | 122 - .../google-cloud-ai_platform/CHANGELOG.md | 2 - .../google-cloud-ai_platform/Gemfile | 28 - .../google-cloud-ai_platform/LICENSE.md | 201 -- .../google-cloud-ai_platform/README.md | 142 - .../google-cloud-ai_platform/Rakefile | 169 -- .../google-cloud-ai_platform.gemspec | 27 - .../lib/google-cloud-ai_platform.rb | 19 - .../lib/google/cloud/ai_platform.rb | 2482 ----------------- .../lib/google/cloud/ai_platform/version.rb | 26 - .../google/cloud/ai_platform/client_test.rb | 757 ----- .../google/cloud/ai_platform/version_test.rb | 26 - .../google-cloud-ai_platform/test/helper.rb | 25 - 20 files changed, 91 insertions(+), 4144 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-ai_platform/.gitignore delete mode 100644 owl-bot-staging/google-cloud-ai_platform/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-ai_platform/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-ai_platform/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-ai_platform/.yardopts delete mode 100644 owl-bot-staging/google-cloud-ai_platform/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-ai_platform/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-ai_platform/Gemfile delete mode 100644 owl-bot-staging/google-cloud-ai_platform/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-ai_platform/README.md delete mode 100644 owl-bot-staging/google-cloud-ai_platform/Rakefile delete mode 100644 owl-bot-staging/google-cloud-ai_platform/google-cloud-ai_platform.gemspec delete mode 100644 owl-bot-staging/google-cloud-ai_platform/lib/google-cloud-ai_platform.rb delete mode 100644 owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform.rb delete mode 100644 owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform/version.rb delete mode 100644 owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-ai_platform/test/helper.rb diff --git a/google-cloud-ai_platform/lib/google/cloud/ai_platform.rb b/google-cloud-ai_platform/lib/google/cloud/ai_platform.rb index 294cfb834d86..2d49e3065a35 100644 --- a/google-cloud-ai_platform/lib/google/cloud/ai_platform.rb +++ b/google-cloud-ai_platform/lib/google/cloud/ai_platform.rb @@ -2012,6 +2012,76 @@ def self.schedule_service_available? version: :v1, transport: :grpc false end + ## + # Create a new client object for SessionService. + # + # By default, this returns an instance of + # [Google::Cloud::AIPlatform::V1::SessionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-SessionService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the SessionService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the SessionService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::AIPlatform.session_service_available?}. + # + # ## About SessionService + # + # The service that manages Vertex Session related resources. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.session_service version: :v1, transport: :grpc, &block + require "google/cloud/ai_platform/#{version.to_s.downcase}" + + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:SessionService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the SessionService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.session_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 SessionService service, + # or if the versioned client gem needs an update to support the SessionService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.session_service_available? version: :v1, transport: :grpc + require "google/cloud/ai_platform/#{version.to_s.downcase}" + package_name = Google::Cloud::AIPlatform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::AIPlatform.const_get package_name + return false unless service_module.const_defined? :SessionService + service_module = service_module.const_get :SessionService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + ## # Create a new client object for SpecialistPoolService. # diff --git a/google-cloud-ai_platform/test/google/cloud/ai_platform/client_test.rb b/google-cloud-ai_platform/test/google/cloud/ai_platform/client_test.rb index c5b7783ad1c8..e8bbb73789bc 100644 --- a/google-cloud-ai_platform/test/google/cloud/ai_platform/client_test.rb +++ b/google-cloud-ai_platform/test/google/cloud/ai_platform/client_test.rb @@ -629,6 +629,27 @@ def test_schedule_service_rest end end + def test_session_service_grpc + skip unless Google::Cloud::AIPlatform.session_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::AIPlatform.session_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::AIPlatform::V1::SessionService::Client, client + end + end + + def test_session_service_rest + skip unless Google::Cloud::AIPlatform.session_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::AIPlatform.session_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::AIPlatform::V1::SessionService::Rest::Client, client + end + end + def test_specialist_pool_service_grpc skip unless Google::Cloud::AIPlatform.specialist_pool_service_available? transport: :grpc Gapic::ServiceStub.stub :new, DummyStub.new do diff --git a/owl-bot-staging/google-cloud-ai_platform/.gitignore b/owl-bot-staging/google-cloud-ai_platform/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/.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-ai_platform/.repo-metadata.json b/owl-bot-staging/google-cloud-ai_platform/.repo-metadata.json deleted file mode 100644 index 1b552aa73b63..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "aiplatform.googleapis.com", - "api_shortname": "aiplatform", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform/latest", - "distribution_name": "google-cloud-ai_platform", - "is_cloud": true, - "language": "ruby", - "name": "aiplatform", - "name_pretty": "Vertex AI API", - "product_documentation": "https://cloud.google.com/vertex-ai/docs/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Vertex AI enables data scientists, developers, and AI newcomers to create custom machine learning models specific to their business needs by leveraging Google's state-of-the-art transfer learning and innovative AI research.", - "ruby-cloud-product-url": "https://cloud.google.com/vertex-ai/docs/", - "ruby-cloud-service-override": "AiPlatform=AIPlatform", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-ai_platform/.rubocop.yml b/owl-bot-staging/google-cloud-ai_platform/.rubocop.yml deleted file mode 100644 index 35c381fe360b..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-ai_platform.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-ai_platform.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-ai_platform/.toys.rb b/owl-bot-staging/google-cloud-ai_platform/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/.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-ai_platform/.yardopts b/owl-bot-staging/google-cloud-ai_platform/.yardopts deleted file mode 100644 index ef9205e4a698..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Vertex AI 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-ai_platform/AUTHENTICATION.md b/owl-bot-staging/google-cloud-ai_platform/AUTHENTICATION.md deleted file mode 100644 index 368825a3e31d..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-ai_platform 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-ai_platform 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/ai_platform" - -client = Google::Cloud::AIPlatform.data_foundry_service do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/ai_platform" - -Google::Cloud::AIPlatform.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::AIPlatform.data_foundry_service -``` - -### 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-ai_platform -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/ai_platform" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::AIPlatform.data_foundry_service -``` - -### 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-ai_platform/CHANGELOG.md b/owl-bot-staging/google-cloud-ai_platform/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-ai_platform/Gemfile b/owl-bot-staging/google-cloud-ai_platform/Gemfile deleted file mode 100644 index 7483ca19e0be..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-ai_platform-v1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-ai_platform.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.30.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-ai_platform/LICENSE.md b/owl-bot-staging/google-cloud-ai_platform/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/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-ai_platform/README.md b/owl-bot-staging/google-cloud-ai_platform/README.md deleted file mode 100644 index 339cdd9cf558..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Vertex AI API - -API Client library for the Vertex AI API - -Vertex AI enables data scientists, developers, and AI newcomers to create custom machine learning models specific to their business needs by leveraging Google's state-of-the-art transfer learning and innovative AI research. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-ai_platform-v*`. -The gem `google-cloud-ai_platform` 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-ai_platform/latest) -for this library, google-cloud-ai_platform, 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-ai_platform-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/vertex-ai/docs/) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-ai_platform -``` - -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/aiplatform.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/ai_platform" - -client = Google::Cloud::AIPlatform.data_foundry_service -request = ::Google::Cloud::AIPlatform::V1::GenerateSyntheticDataRequest.new # (request fields as keyword arguments...) -response = client.generate_synthetic_data 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-ai_platform-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-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-ai_platform`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-ai_platform-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-ai_platform`. -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-ai_platform-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-ai_platform/Rakefile b/owl-bot-staging/google-cloud-ai_platform/Rakefile deleted file mode 100644 index 6bc1601321de..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/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-ai_platform acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/ai_platform/v1/data_foundry_service/credentials" - ::Google::Cloud::AIPlatform::V1::DataFoundryService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_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-ai_platform 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-ai_platform 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-ai_platform 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-ai_platform gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-ai_platform" - header "google-cloud-ai_platform rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-ai_platform yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-ai_platform 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-ai_platform 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-ai_platform 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-ai_platform/google-cloud-ai_platform.gemspec b/owl-bot-staging/google-cloud-ai_platform/google-cloud-ai_platform.gemspec deleted file mode 100644 index d2959b95283d..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/google-cloud-ai_platform.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/ai_platform/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-ai_platform" - gem.version = Google::Cloud::AIPlatform::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Vertex AI enables data scientists, developers, and AI newcomers to create custom machine learning models specific to their business needs by leveraging Google's state-of-the-art transfer learning and innovative AI research." - gem.summary = "API Client library for the Vertex AI 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.0" - - gem.add_dependency "google-cloud-ai_platform-v1", "~> 1.0" - gem.add_dependency "google-cloud-core", "~> 1.6" -end diff --git a/owl-bot-staging/google-cloud-ai_platform/lib/google-cloud-ai_platform.rb b/owl-bot-staging/google-cloud-ai_platform/lib/google-cloud-ai_platform.rb deleted file mode 100644 index 55c3776b2dba..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/lib/google-cloud-ai_platform.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/ai_platform" unless defined? Google::Cloud::AIPlatform::VERSION diff --git a/owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform.rb b/owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform.rb deleted file mode 100644 index ff1a326d6a44..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform.rb +++ /dev/null @@ -1,2482 +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/ai_platform/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! :ai_platform 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! :interceptors, nil, match: ::Array - 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 AIPlatform - ## - # Create a new client object for DataFoundryService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::DataFoundryService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-DataFoundryService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the DataFoundryService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the DataFoundryService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.data_foundry_service_available?}. - # - # ## About DataFoundryService - # - # Service for generating and preparing datasets for Gen AI evaluation. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.data_foundry_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:DataFoundryService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the DataFoundryService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.data_foundry_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 DataFoundryService service, - # or if the versioned client gem needs an update to support the DataFoundryService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.data_foundry_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :DataFoundryService - service_module = service_module.const_get :DataFoundryService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for DatasetService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::DatasetService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-DatasetService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the DatasetService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the DatasetService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.dataset_service_available?}. - # - # ## About DatasetService - # - # The service that manages Vertex AI Dataset and its child resources. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.dataset_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:DatasetService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the DatasetService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.dataset_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 DatasetService service, - # or if the versioned client gem needs an update to support the DatasetService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.dataset_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :DatasetService - service_module = service_module.const_get :DatasetService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for DeploymentResourcePoolService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-DeploymentResourcePoolService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the DeploymentResourcePoolService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the DeploymentResourcePoolService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.deployment_resource_pool_service_available?}. - # - # ## About DeploymentResourcePoolService - # - # A service that manages the DeploymentResourcePool resource. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.deployment_resource_pool_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:DeploymentResourcePoolService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the DeploymentResourcePoolService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.deployment_resource_pool_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 DeploymentResourcePoolService service, - # or if the versioned client gem needs an update to support the DeploymentResourcePoolService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.deployment_resource_pool_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :DeploymentResourcePoolService - service_module = service_module.const_get :DeploymentResourcePoolService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for EndpointService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::EndpointService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-EndpointService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the EndpointService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the EndpointService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.endpoint_service_available?}. - # - # ## About EndpointService - # - # A service for managing Vertex AI's Endpoints. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.endpoint_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:EndpointService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the EndpointService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.endpoint_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 EndpointService service, - # or if the versioned client gem needs an update to support the EndpointService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.endpoint_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :EndpointService - service_module = service_module.const_get :EndpointService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for EvaluationService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::EvaluationService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-EvaluationService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the EvaluationService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the EvaluationService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.evaluation_service_available?}. - # - # ## About EvaluationService - # - # Vertex AI Online Evaluation Service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.evaluation_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:EvaluationService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the EvaluationService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.evaluation_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 EvaluationService service, - # or if the versioned client gem needs an update to support the EvaluationService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.evaluation_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :EvaluationService - service_module = service_module.const_get :EvaluationService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for FeatureOnlineStoreAdminService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-FeatureOnlineStoreAdminService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the FeatureOnlineStoreAdminService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the FeatureOnlineStoreAdminService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.feature_online_store_admin_service_available?}. - # - # ## About FeatureOnlineStoreAdminService - # - # The service that handles CRUD and List for resources for - # FeatureOnlineStore. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.feature_online_store_admin_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:FeatureOnlineStoreAdminService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the FeatureOnlineStoreAdminService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.feature_online_store_admin_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 FeatureOnlineStoreAdminService service, - # or if the versioned client gem needs an update to support the FeatureOnlineStoreAdminService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.feature_online_store_admin_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :FeatureOnlineStoreAdminService - service_module = service_module.const_get :FeatureOnlineStoreAdminService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for FeaturestoreOnlineServingService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-FeaturestoreOnlineServingService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the FeaturestoreOnlineServingService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the FeaturestoreOnlineServingService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.featurestore_online_serving_service_available?}. - # - # ## About FeaturestoreOnlineServingService - # - # A service for serving online feature values. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.featurestore_online_serving_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:FeaturestoreOnlineServingService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the FeaturestoreOnlineServingService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.featurestore_online_serving_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 FeaturestoreOnlineServingService service, - # or if the versioned client gem needs an update to support the FeaturestoreOnlineServingService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.featurestore_online_serving_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :FeaturestoreOnlineServingService - service_module = service_module.const_get :FeaturestoreOnlineServingService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for FeatureOnlineStoreService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-FeatureOnlineStoreService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the FeatureOnlineStoreService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the FeatureOnlineStoreService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.feature_online_store_service_available?}. - # - # ## About FeatureOnlineStoreService - # - # A service for fetching feature values from the online store. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.feature_online_store_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:FeatureOnlineStoreService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the FeatureOnlineStoreService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.feature_online_store_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 FeatureOnlineStoreService service, - # or if the versioned client gem needs an update to support the FeatureOnlineStoreService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.feature_online_store_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :FeatureOnlineStoreService - service_module = service_module.const_get :FeatureOnlineStoreService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for FeaturestoreService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::FeaturestoreService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-FeaturestoreService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the FeaturestoreService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the FeaturestoreService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.featurestore_service_available?}. - # - # ## About FeaturestoreService - # - # The service that handles CRUD and List for resources for Featurestore. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.featurestore_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:FeaturestoreService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the FeaturestoreService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.featurestore_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 FeaturestoreService service, - # or if the versioned client gem needs an update to support the FeaturestoreService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.featurestore_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :FeaturestoreService - service_module = service_module.const_get :FeaturestoreService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for FeatureRegistryService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-FeatureRegistryService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the FeatureRegistryService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the FeatureRegistryService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.feature_registry_service_available?}. - # - # ## About FeatureRegistryService - # - # The service that handles CRUD and List for resources for - # FeatureRegistry. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.feature_registry_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:FeatureRegistryService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the FeatureRegistryService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.feature_registry_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 FeatureRegistryService service, - # or if the versioned client gem needs an update to support the FeatureRegistryService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.feature_registry_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :FeatureRegistryService - service_module = service_module.const_get :FeatureRegistryService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for GenAiCacheService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::GenAiCacheService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenAiCacheService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the GenAiCacheService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the GenAiCacheService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.gen_ai_cache_service_available?}. - # - # ## About GenAiCacheService - # - # Service for managing Vertex AI's CachedContent resource. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.gen_ai_cache_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:GenAiCacheService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the GenAiCacheService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.gen_ai_cache_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 GenAiCacheService service, - # or if the versioned client gem needs an update to support the GenAiCacheService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.gen_ai_cache_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :GenAiCacheService - service_module = service_module.const_get :GenAiCacheService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for GenAiTuningService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::GenAiTuningService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenAiTuningService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the GenAiTuningService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the GenAiTuningService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.gen_ai_tuning_service_available?}. - # - # ## About GenAiTuningService - # - # A service for creating and managing GenAI Tuning Jobs. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.gen_ai_tuning_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:GenAiTuningService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the GenAiTuningService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.gen_ai_tuning_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 GenAiTuningService service, - # or if the versioned client gem needs an update to support the GenAiTuningService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.gen_ai_tuning_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :GenAiTuningService - service_module = service_module.const_get :GenAiTuningService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for IndexEndpointService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::IndexEndpointService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-IndexEndpointService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the IndexEndpointService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the IndexEndpointService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.index_endpoint_service_available?}. - # - # ## About IndexEndpointService - # - # A service for managing Vertex AI's IndexEndpoints. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.index_endpoint_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:IndexEndpointService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the IndexEndpointService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.index_endpoint_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 IndexEndpointService service, - # or if the versioned client gem needs an update to support the IndexEndpointService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.index_endpoint_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :IndexEndpointService - service_module = service_module.const_get :IndexEndpointService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for IndexService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::IndexService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-IndexService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the IndexService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the IndexService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.index_service_available?}. - # - # ## About IndexService - # - # A service for creating and managing Vertex AI's Index resources. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.index_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:IndexService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the IndexService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.index_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 IndexService service, - # or if the versioned client gem needs an update to support the IndexService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.index_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :IndexService - service_module = service_module.const_get :IndexService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for JobService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::JobService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-JobService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the JobService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the JobService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.job_service_available?}. - # - # ## About JobService - # - # A service for creating and managing Vertex AI's jobs. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.job_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:JobService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the JobService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.job_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 JobService service, - # or if the versioned client gem needs an update to support the JobService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.job_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :JobService - service_module = service_module.const_get :JobService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for PredictionService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::PredictionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-PredictionService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the PredictionService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the PredictionService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.prediction_service_available?}. - # - # ## About PredictionService - # - # A service for online predictions and explanations. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.prediction_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:PredictionService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the PredictionService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.prediction_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 PredictionService service, - # or if the versioned client gem needs an update to support the PredictionService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.prediction_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :PredictionService - service_module = service_module.const_get :PredictionService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for LlmUtilityService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::LlmUtilityService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-LlmUtilityService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the LlmUtilityService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the LlmUtilityService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.llm_utility_service_available?}. - # - # ## About LlmUtilityService - # - # Service for LLM related utility functions. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.llm_utility_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:LlmUtilityService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the LlmUtilityService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.llm_utility_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 LlmUtilityService service, - # or if the versioned client gem needs an update to support the LlmUtilityService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.llm_utility_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :LlmUtilityService - service_module = service_module.const_get :LlmUtilityService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for MatchService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::MatchService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-MatchService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the MatchService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the MatchService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.match_service_available?}. - # - # ## About MatchService - # - # MatchService is a Google managed service for efficient vector similarity - # search at scale. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.match_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:MatchService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the MatchService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.match_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 MatchService service, - # or if the versioned client gem needs an update to support the MatchService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.match_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :MatchService - service_module = service_module.const_get :MatchService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for MetadataService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::MetadataService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-MetadataService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the MetadataService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the MetadataService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.metadata_service_available?}. - # - # ## About MetadataService - # - # Service for reading and writing metadata entries. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.metadata_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:MetadataService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the MetadataService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.metadata_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 MetadataService service, - # or if the versioned client gem needs an update to support the MetadataService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.metadata_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :MetadataService - service_module = service_module.const_get :MetadataService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for MigrationService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::MigrationService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-MigrationService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the MigrationService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the MigrationService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.migration_service_available?}. - # - # ## About MigrationService - # - # A service that migrates resources from automl.googleapis.com, - # datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.migration_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:MigrationService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the MigrationService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.migration_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 MigrationService service, - # or if the versioned client gem needs an update to support the MigrationService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.migration_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :MigrationService - service_module = service_module.const_get :MigrationService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ModelGardenService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::ModelGardenService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-ModelGardenService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ModelGardenService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the ModelGardenService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.model_garden_service_available?}. - # - # ## About ModelGardenService - # - # The interface of Model Garden Service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.model_garden_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:ModelGardenService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the ModelGardenService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.model_garden_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 ModelGardenService service, - # or if the versioned client gem needs an update to support the ModelGardenService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.model_garden_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :ModelGardenService - service_module = service_module.const_get :ModelGardenService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ModelService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::ModelService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-ModelService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ModelService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the ModelService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.model_service_available?}. - # - # ## About ModelService - # - # A service for managing Vertex AI's machine learning Models. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.model_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:ModelService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the ModelService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.model_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 ModelService service, - # or if the versioned client gem needs an update to support the ModelService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.model_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :ModelService - service_module = service_module.const_get :ModelService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for NotebookService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::NotebookService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-NotebookService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the NotebookService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the NotebookService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.notebook_service_available?}. - # - # ## About NotebookService - # - # The interface for Vertex Notebook service (a.k.a. Colab on Workbench). - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.notebook_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:NotebookService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the NotebookService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.notebook_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 NotebookService service, - # or if the versioned client gem needs an update to support the NotebookService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.notebook_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :NotebookService - service_module = service_module.const_get :NotebookService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for PersistentResourceService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::PersistentResourceService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-PersistentResourceService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the PersistentResourceService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the PersistentResourceService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.persistent_resource_service_available?}. - # - # ## About PersistentResourceService - # - # A service for managing Vertex AI's machine learning PersistentResource. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.persistent_resource_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:PersistentResourceService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the PersistentResourceService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.persistent_resource_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 PersistentResourceService service, - # or if the versioned client gem needs an update to support the PersistentResourceService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.persistent_resource_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :PersistentResourceService - service_module = service_module.const_get :PersistentResourceService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for PipelineService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::PipelineService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-PipelineService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the PipelineService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the PipelineService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.pipeline_service_available?}. - # - # ## About PipelineService - # - # A service for creating and managing Vertex AI's pipelines. This includes both - # `TrainingPipeline` resources (used for AutoML and custom training) and - # `PipelineJob` resources (used for Vertex AI Pipelines). - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.pipeline_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:PipelineService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the PipelineService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.pipeline_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 PipelineService service, - # or if the versioned client gem needs an update to support the PipelineService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.pipeline_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :PipelineService - service_module = service_module.const_get :PipelineService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ReasoningEngineExecutionService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-ReasoningEngineExecutionService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ReasoningEngineExecutionService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the ReasoningEngineExecutionService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.reasoning_engine_execution_service_available?}. - # - # ## About ReasoningEngineExecutionService - # - # A service for executing queries on Reasoning Engine. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.reasoning_engine_execution_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:ReasoningEngineExecutionService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the ReasoningEngineExecutionService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.reasoning_engine_execution_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 ReasoningEngineExecutionService service, - # or if the versioned client gem needs an update to support the ReasoningEngineExecutionService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.reasoning_engine_execution_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :ReasoningEngineExecutionService - service_module = service_module.const_get :ReasoningEngineExecutionService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ReasoningEngineService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-ReasoningEngineService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ReasoningEngineService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the ReasoningEngineService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.reasoning_engine_service_available?}. - # - # ## About ReasoningEngineService - # - # A service for managing Vertex AI's Reasoning Engines. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.reasoning_engine_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:ReasoningEngineService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the ReasoningEngineService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.reasoning_engine_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 ReasoningEngineService service, - # or if the versioned client gem needs an update to support the ReasoningEngineService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.reasoning_engine_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :ReasoningEngineService - service_module = service_module.const_get :ReasoningEngineService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ScheduleService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::ScheduleService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-ScheduleService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ScheduleService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the ScheduleService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.schedule_service_available?}. - # - # ## About ScheduleService - # - # A service for creating and managing Vertex AI's Schedule resources to - # periodically launch shceudled runs to make API calls. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.schedule_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:ScheduleService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the ScheduleService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.schedule_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 ScheduleService service, - # or if the versioned client gem needs an update to support the ScheduleService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.schedule_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :ScheduleService - service_module = service_module.const_get :ScheduleService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for SessionService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::SessionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-SessionService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the SessionService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the SessionService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.session_service_available?}. - # - # ## About SessionService - # - # The service that manages Vertex Session related resources. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.session_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:SessionService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the SessionService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.session_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 SessionService service, - # or if the versioned client gem needs an update to support the SessionService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.session_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :SessionService - service_module = service_module.const_get :SessionService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for SpecialistPoolService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-SpecialistPoolService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the SpecialistPoolService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the SpecialistPoolService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.specialist_pool_service_available?}. - # - # ## About SpecialistPoolService - # - # A service for creating and managing Customer SpecialistPools. - # When customers start Data Labeling jobs, they can reuse/create Specialist - # Pools to bring their own Specialists to label the data. - # Customers can add/remove Managers for the Specialist Pool on Cloud console, - # then Managers will get email notifications to manage Specialists and tasks on - # CrowdCompute console. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.specialist_pool_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:SpecialistPoolService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the SpecialistPoolService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.specialist_pool_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 SpecialistPoolService service, - # or if the versioned client gem needs an update to support the SpecialistPoolService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.specialist_pool_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :SpecialistPoolService - service_module = service_module.const_get :SpecialistPoolService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for TensorboardService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::TensorboardService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-TensorboardService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TensorboardService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the TensorboardService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.tensorboard_service_available?}. - # - # ## About TensorboardService - # - # TensorboardService - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.tensorboard_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:TensorboardService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the TensorboardService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.tensorboard_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 TensorboardService service, - # or if the versioned client gem needs an update to support the TensorboardService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.tensorboard_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :TensorboardService - service_module = service_module.const_get :TensorboardService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for VertexRagDataService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::VertexRagDataService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-VertexRagDataService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the VertexRagDataService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the VertexRagDataService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.vertex_rag_data_service_available?}. - # - # ## About VertexRagDataService - # - # A service for managing user data for RAG. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.vertex_rag_data_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:VertexRagDataService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the VertexRagDataService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.vertex_rag_data_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 VertexRagDataService service, - # or if the versioned client gem needs an update to support the VertexRagDataService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.vertex_rag_data_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :VertexRagDataService - service_module = service_module.const_get :VertexRagDataService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for VertexRagService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::VertexRagService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-VertexRagService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the VertexRagService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the VertexRagService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.vertex_rag_service_available?}. - # - # ## About VertexRagService - # - # A service for retrieving relevant contexts. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.vertex_rag_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:VertexRagService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the VertexRagService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.vertex_rag_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 VertexRagService service, - # or if the versioned client gem needs an update to support the VertexRagService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.vertex_rag_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :VertexRagService - service_module = service_module.const_get :VertexRagService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for VizierService. - # - # By default, this returns an instance of - # [Google::Cloud::AIPlatform::V1::VizierService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-VizierService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the VizierService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the VizierService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::AIPlatform.vizier_service_available?}. - # - # ## About VizierService - # - # Vertex AI Vizier API. - # - # Vertex AI Vizier is a service to solve blackbox optimization problems, - # such as tuning machine learning hyperparameters and searching over deep - # learning architectures. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.vizier_service version: :v1, transport: :grpc, &block - require "google/cloud/ai_platform/#{version.to_s.downcase}" - - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::AIPlatform.const_get(package_name).const_get(:VizierService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the VizierService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::AIPlatform.vizier_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 VizierService service, - # or if the versioned client gem needs an update to support the VizierService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.vizier_service_available? version: :v1, transport: :grpc - require "google/cloud/ai_platform/#{version.to_s.downcase}" - package_name = Google::Cloud::AIPlatform - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::AIPlatform.const_get package_name - return false unless service_module.const_defined? :VizierService - service_module = service_module.const_get :VizierService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-ai_platform 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. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `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.ai_platform if block_given? - - ::Google::Cloud.configure.ai_platform - end - end - end -end - -helper_path = ::File.join __dir__, "ai_platform", "helpers.rb" -require "google/cloud/ai_platform/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform/version.rb b/owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform/version.rb deleted file mode 100644 index 1e6c51cb3574..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/lib/google/cloud/ai_platform/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 AIPlatform - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/client_test.rb b/owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/client_test.rb deleted file mode 100644 index 719f9ef60c57..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/client_test.rb +++ /dev/null @@ -1,757 +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/ai_platform" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::AIPlatform::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_data_foundry_service_grpc - skip unless Google::Cloud::AIPlatform.data_foundry_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.data_foundry_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::DataFoundryService::Client, client - end - end - - def test_data_foundry_service_rest - skip unless Google::Cloud::AIPlatform.data_foundry_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.data_foundry_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::DataFoundryService::Rest::Client, client - end - end - - def test_dataset_service_grpc - skip unless Google::Cloud::AIPlatform.dataset_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.dataset_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::DatasetService::Client, client - end - end - - def test_dataset_service_rest - skip unless Google::Cloud::AIPlatform.dataset_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.dataset_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::DatasetService::Rest::Client, client - end - end - - def test_deployment_resource_pool_service_grpc - skip unless Google::Cloud::AIPlatform.deployment_resource_pool_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.deployment_resource_pool_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client, client - end - end - - def test_deployment_resource_pool_service_rest - skip unless Google::Cloud::AIPlatform.deployment_resource_pool_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.deployment_resource_pool_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Rest::Client, client - end - end - - def test_endpoint_service_grpc - skip unless Google::Cloud::AIPlatform.endpoint_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.endpoint_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::EndpointService::Client, client - end - end - - def test_endpoint_service_rest - skip unless Google::Cloud::AIPlatform.endpoint_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.endpoint_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::EndpointService::Rest::Client, client - end - end - - def test_evaluation_service_grpc - skip unless Google::Cloud::AIPlatform.evaluation_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.evaluation_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::EvaluationService::Client, client - end - end - - def test_evaluation_service_rest - skip unless Google::Cloud::AIPlatform.evaluation_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.evaluation_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::EvaluationService::Rest::Client, client - end - end - - def test_feature_online_store_admin_service_grpc - skip unless Google::Cloud::AIPlatform.feature_online_store_admin_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.feature_online_store_admin_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Client, client - end - end - - def test_feature_online_store_admin_service_rest - skip unless Google::Cloud::AIPlatform.feature_online_store_admin_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.feature_online_store_admin_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::FeatureOnlineStoreAdminService::Rest::Client, client - end - end - - def test_featurestore_online_serving_service_grpc - skip unless Google::Cloud::AIPlatform.featurestore_online_serving_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.featurestore_online_serving_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client, client - end - end - - def test_featurestore_online_serving_service_rest - skip unless Google::Cloud::AIPlatform.featurestore_online_serving_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.featurestore_online_serving_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Rest::Client, client - end - end - - def test_feature_online_store_service_grpc - skip unless Google::Cloud::AIPlatform.feature_online_store_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.feature_online_store_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client, client - end - end - - def test_feature_online_store_service_rest - skip unless Google::Cloud::AIPlatform.feature_online_store_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.feature_online_store_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Rest::Client, client - end - end - - def test_featurestore_service_grpc - skip unless Google::Cloud::AIPlatform.featurestore_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.featurestore_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::FeaturestoreService::Client, client - end - end - - def test_featurestore_service_rest - skip unless Google::Cloud::AIPlatform.featurestore_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.featurestore_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::FeaturestoreService::Rest::Client, client - end - end - - def test_feature_registry_service_grpc - skip unless Google::Cloud::AIPlatform.feature_registry_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.feature_registry_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client, client - end - end - - def test_feature_registry_service_rest - skip unless Google::Cloud::AIPlatform.feature_registry_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.feature_registry_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::FeatureRegistryService::Rest::Client, client - end - end - - def test_gen_ai_cache_service_grpc - skip unless Google::Cloud::AIPlatform.gen_ai_cache_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.gen_ai_cache_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::GenAiCacheService::Client, client - end - end - - def test_gen_ai_cache_service_rest - skip unless Google::Cloud::AIPlatform.gen_ai_cache_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.gen_ai_cache_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::GenAiCacheService::Rest::Client, client - end - end - - def test_gen_ai_tuning_service_grpc - skip unless Google::Cloud::AIPlatform.gen_ai_tuning_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.gen_ai_tuning_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::GenAiTuningService::Client, client - end - end - - def test_gen_ai_tuning_service_rest - skip unless Google::Cloud::AIPlatform.gen_ai_tuning_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.gen_ai_tuning_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::GenAiTuningService::Rest::Client, client - end - end - - def test_index_endpoint_service_grpc - skip unless Google::Cloud::AIPlatform.index_endpoint_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.index_endpoint_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::IndexEndpointService::Client, client - end - end - - def test_index_endpoint_service_rest - skip unless Google::Cloud::AIPlatform.index_endpoint_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.index_endpoint_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::IndexEndpointService::Rest::Client, client - end - end - - def test_index_service_grpc - skip unless Google::Cloud::AIPlatform.index_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.index_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::IndexService::Client, client - end - end - - def test_index_service_rest - skip unless Google::Cloud::AIPlatform.index_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.index_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::IndexService::Rest::Client, client - end - end - - def test_job_service_grpc - skip unless Google::Cloud::AIPlatform.job_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.job_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::JobService::Client, client - end - end - - def test_job_service_rest - skip unless Google::Cloud::AIPlatform.job_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.job_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::JobService::Rest::Client, client - end - end - - def test_prediction_service_grpc - skip unless Google::Cloud::AIPlatform.prediction_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.prediction_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::PredictionService::Client, client - end - end - - def test_prediction_service_rest - skip unless Google::Cloud::AIPlatform.prediction_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.prediction_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::PredictionService::Rest::Client, client - end - end - - def test_llm_utility_service_grpc - skip unless Google::Cloud::AIPlatform.llm_utility_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.llm_utility_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::LlmUtilityService::Client, client - end - end - - def test_llm_utility_service_rest - skip unless Google::Cloud::AIPlatform.llm_utility_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.llm_utility_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::LlmUtilityService::Rest::Client, client - end - end - - def test_match_service_grpc - skip unless Google::Cloud::AIPlatform.match_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.match_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::MatchService::Client, client - end - end - - def test_match_service_rest - skip unless Google::Cloud::AIPlatform.match_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.match_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::MatchService::Rest::Client, client - end - end - - def test_metadata_service_grpc - skip unless Google::Cloud::AIPlatform.metadata_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.metadata_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::MetadataService::Client, client - end - end - - def test_metadata_service_rest - skip unless Google::Cloud::AIPlatform.metadata_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.metadata_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::MetadataService::Rest::Client, client - end - end - - def test_migration_service_grpc - skip unless Google::Cloud::AIPlatform.migration_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.migration_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::MigrationService::Client, client - end - end - - def test_migration_service_rest - skip unless Google::Cloud::AIPlatform.migration_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.migration_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::MigrationService::Rest::Client, client - end - end - - def test_model_garden_service_grpc - skip unless Google::Cloud::AIPlatform.model_garden_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.model_garden_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::ModelGardenService::Client, client - end - end - - def test_model_garden_service_rest - skip unless Google::Cloud::AIPlatform.model_garden_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.model_garden_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::ModelGardenService::Rest::Client, client - end - end - - def test_model_service_grpc - skip unless Google::Cloud::AIPlatform.model_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.model_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::ModelService::Client, client - end - end - - def test_model_service_rest - skip unless Google::Cloud::AIPlatform.model_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.model_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::ModelService::Rest::Client, client - end - end - - def test_notebook_service_grpc - skip unless Google::Cloud::AIPlatform.notebook_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.notebook_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::NotebookService::Client, client - end - end - - def test_notebook_service_rest - skip unless Google::Cloud::AIPlatform.notebook_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.notebook_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::NotebookService::Rest::Client, client - end - end - - def test_persistent_resource_service_grpc - skip unless Google::Cloud::AIPlatform.persistent_resource_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.persistent_resource_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::PersistentResourceService::Client, client - end - end - - def test_persistent_resource_service_rest - skip unless Google::Cloud::AIPlatform.persistent_resource_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.persistent_resource_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::PersistentResourceService::Rest::Client, client - end - end - - def test_pipeline_service_grpc - skip unless Google::Cloud::AIPlatform.pipeline_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.pipeline_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::PipelineService::Client, client - end - end - - def test_pipeline_service_rest - skip unless Google::Cloud::AIPlatform.pipeline_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.pipeline_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::PipelineService::Rest::Client, client - end - end - - def test_reasoning_engine_execution_service_grpc - skip unless Google::Cloud::AIPlatform.reasoning_engine_execution_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.reasoning_engine_execution_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client, client - end - end - - def test_reasoning_engine_execution_service_rest - skip unless Google::Cloud::AIPlatform.reasoning_engine_execution_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.reasoning_engine_execution_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client, client - end - end - - def test_reasoning_engine_service_grpc - skip unless Google::Cloud::AIPlatform.reasoning_engine_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.reasoning_engine_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client, client - end - end - - def test_reasoning_engine_service_rest - skip unless Google::Cloud::AIPlatform.reasoning_engine_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.reasoning_engine_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client, client - end - end - - def test_schedule_service_grpc - skip unless Google::Cloud::AIPlatform.schedule_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.schedule_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::ScheduleService::Client, client - end - end - - def test_schedule_service_rest - skip unless Google::Cloud::AIPlatform.schedule_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.schedule_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::ScheduleService::Rest::Client, client - end - end - - def test_session_service_grpc - skip unless Google::Cloud::AIPlatform.session_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.session_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::SessionService::Client, client - end - end - - def test_session_service_rest - skip unless Google::Cloud::AIPlatform.session_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.session_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::SessionService::Rest::Client, client - end - end - - def test_specialist_pool_service_grpc - skip unless Google::Cloud::AIPlatform.specialist_pool_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.specialist_pool_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client, client - end - end - - def test_specialist_pool_service_rest - skip unless Google::Cloud::AIPlatform.specialist_pool_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.specialist_pool_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::SpecialistPoolService::Rest::Client, client - end - end - - def test_tensorboard_service_grpc - skip unless Google::Cloud::AIPlatform.tensorboard_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.tensorboard_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::TensorboardService::Client, client - end - end - - def test_tensorboard_service_rest - skip unless Google::Cloud::AIPlatform.tensorboard_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.tensorboard_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::TensorboardService::Rest::Client, client - end - end - - def test_vertex_rag_data_service_grpc - skip unless Google::Cloud::AIPlatform.vertex_rag_data_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.vertex_rag_data_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::VertexRagDataService::Client, client - end - end - - def test_vertex_rag_data_service_rest - skip unless Google::Cloud::AIPlatform.vertex_rag_data_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.vertex_rag_data_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client, client - end - end - - def test_vertex_rag_service_grpc - skip unless Google::Cloud::AIPlatform.vertex_rag_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.vertex_rag_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::VertexRagService::Client, client - end - end - - def test_vertex_rag_service_rest - skip unless Google::Cloud::AIPlatform.vertex_rag_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.vertex_rag_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::VertexRagService::Rest::Client, client - end - end - - def test_vizier_service_grpc - skip unless Google::Cloud::AIPlatform.vizier_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::AIPlatform.vizier_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::AIPlatform::V1::VizierService::Client, client - end - end - - def test_vizier_service_rest - skip unless Google::Cloud::AIPlatform.vizier_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::AIPlatform.vizier_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::AIPlatform::V1::VizierService::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/version_test.rb b/owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/version_test.rb deleted file mode 100644 index 9acdfb96a3c7..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/test/google/cloud/ai_platform/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/ai_platform/version" - -class Google::Cloud::AIPlatform::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::AIPlatform::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-ai_platform/test/helper.rb b/owl-bot-staging/google-cloud-ai_platform/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-ai_platform/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"